Class SprintResource
java.lang.Object
com.atlassian.greenhopper.web.AbstractResource
com.atlassian.greenhopper.web.rapid.sprint.SprintResource
@Path("sprint")
@Consumes("application/json")
@Produces("application/json")
public class SprintResource
extends AbstractResource
-
Field Summary
Fields inherited from class com.atlassian.greenhopper.web.AbstractResource
authenticationContext, log
-
Constructor Summary
ConstructorsConstructorDescriptionSprintResource
(RapidViewService rapidViewService, SprintService sprintService, SprintPermissionService sprintPermissionService, SprintEntryFactory sprintEntryFactory, I18nFactoryService i18nFactoryService, RapidViewSprintQueryService rapidViewSprintQueryService, SprintHelper sprintHelper, SprintSeeker sprintSeeker, RecentSprintHistoryService recentSprintHistoryService, com.atlassian.jira.datetime.DateTimeFormatter dateTimeFormatterFactory, SprintAutoStartService autoStartService, SprintAutoStopService autoStopService, com.atlassian.greenhopper.api.rest.util.ResponseFactory responseFactory, PermissionService permissionService, com.atlassian.jira.timezone.TimeZoneService timeZoneService) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Response
Triggers one run ofSprintAutoStartService
.jakarta.ws.rs.core.Response
Triggers one run ofSprintAutoStopService
.jakarta.ws.rs.core.Response
createSprint
(com.atlassian.greenhopper.api.rest.bean.SprintCreateBean sprintCreateBean, Long rapidViewId) Create a new sprint from existing data in SprintCreateBean for a given rapid view.jakarta.ws.rs.core.Response
deleteSprint
(Long sprintId, Long rapidViewId) Delete a sprint given its id.jakarta.ws.rs.core.Response
getCreateSprintModel
(Long rapidViewId, boolean suggestDates) Returns default sprint model for creating a sprintjakarta.ws.rs.core.Response
getEditModel
(Long sprintId) Returns the model of a sprint that can be used to edit the details of the sprint.jakarta.ws.rs.core.Response
listSprints
(String searchQuery, int maxResults, boolean excludeCompleted, String projectKey) jakarta.ws.rs.core.Response
moveSprint
(Long sprintId, SwapSprintRequest swapSprintRequest) Changes the sequence of two sprints by swapping their sequencejakarta.ws.rs.core.Response
updateSprint
(Long sprintId, UpdateSprintRequest updateSprintRequest) Updates a sprint with the given ID with the given update object.Methods inherited from class com.atlassian.greenhopper.web.AbstractResource
check, checkResult, createNoContentResponse, createOkResponse, createOkResponse, getUser, isGadgetRequest, nullSafe, response, responseWithoutAccessCheck
-
Constructor Details
-
SprintResource
@Inject public SprintResource(RapidViewService rapidViewService, SprintService sprintService, SprintPermissionService sprintPermissionService, SprintEntryFactory sprintEntryFactory, I18nFactoryService i18nFactoryService, RapidViewSprintQueryService rapidViewSprintQueryService, SprintHelper sprintHelper, SprintSeeker sprintSeeker, RecentSprintHistoryService recentSprintHistoryService, com.atlassian.jira.datetime.DateTimeFormatter dateTimeFormatterFactory, SprintAutoStartService autoStartService, SprintAutoStopService autoStopService, com.atlassian.greenhopper.api.rest.util.ResponseFactory responseFactory, PermissionService permissionService, com.atlassian.jira.timezone.TimeZoneService timeZoneService)
-
-
Method Details
-
listSprints
@GET @Path("/picker") public jakarta.ws.rs.core.Response listSprints(@DefaultValue("") @QueryParam("query") String searchQuery, @DefaultValue("50") @QueryParam("maxResults") int maxResults, @DefaultValue("true") @QueryParam("excludeCompleted") boolean excludeCompleted, @Nullable @QueryParam("project") String projectKey) -
getEditModel
@GET @Path("{sprintId}/edit/model") public jakarta.ws.rs.core.Response getEditModel(@PathParam("sprintId") Long sprintId) Returns the model of a sprint that can be used to edit the details of the sprint.- Parameters:
sprintId
- The ID of the sprint- Returns:
- a model containing the details of the sprint
-
createSprint
@POST @Path("{rapidViewId}") public jakarta.ws.rs.core.Response createSprint(com.atlassian.greenhopper.api.rest.bean.SprintCreateBean sprintCreateBean, @PathParam("rapidViewId") Long rapidViewId) Create a new sprint from existing data in SprintCreateBean for a given rapid view. If no name is provided, the name will be suggested. All other parameters are optional. -
getCreateSprintModel
@GET @Path("{rapidViewId}/create/model") public jakarta.ws.rs.core.Response getCreateSprintModel(@PathParam("rapidViewId") Long rapidViewId, @QueryParam("suggestDates") @DefaultValue("false") boolean suggestDates) Returns default sprint model for creating a sprint -
updateSprint
@PUT @Path("{sprintId}") public jakarta.ws.rs.core.Response updateSprint(@PathParam("sprintId") Long sprintId, UpdateSprintRequest updateSprintRequest) Updates a sprint with the given ID with the given update object. The name, startDate, endDate, goal and autoStartStop sprint properties of a sprint can be updated. If the autoStartStop sprint property is equal to null, this property will be not updated and original value will remain the same.- Parameters:
sprintId
- The ID of a sprintupdateSprintRequest
- An update request containing the name, startDate, endDate and goal with which the sprint will be updated.- Returns:
- The updated sprint
-
moveSprint
@PUT @Path("{sprintId}/swap") public jakarta.ws.rs.core.Response moveSprint(@PathParam("sprintId") Long sprintId, SwapSprintRequest swapSprintRequest) Changes the sequence of two sprints by swapping their sequence- Parameters:
sprintId
- The ID of a sprintswapSprintRequest
- An update request containing the sprint to swap with- Returns:
- the updated sprint object
-
deleteSprint
@DELETE @Path("{sprintId}") public jakarta.ws.rs.core.Response deleteSprint(@PathParam("sprintId") Long sprintId, @QueryParam("rapidViewId") Long rapidViewId) Delete a sprint given its id.Specify the rapid view to automatically add issues in the sprint to the next upcoming sprint
-
autoStartSprints
@POST @Path("autoStartSprint") public jakarta.ws.rs.core.Response autoStartSprints()Triggers one run ofSprintAutoStartService
. Method will move sprints to active state (seeSprint.State.ACTIVE
) if sprint is automatically managed (seeSprint.isAutoStartStop()
), future (seeSprint.State.FUTURE
) and sprint's started date (seeSprint.getStartDate()
) has already passed. -
autoStopSprints
@POST @Path("autoStopSprint") public jakarta.ws.rs.core.Response autoStopSprints()Triggers one run ofSprintAutoStopService
. Method will move sprints to closed state (seeSprint.State.CLOSED
) if sprint is automatically managed (seeSprint.isAutoStartStop()
), active (seeSprint.State.ACTIVE
) and sprint's end date (seeSprint.getEndDate()
) has already passed.
-