Class RoadMapResource
java.lang.Object
com.atlassian.jira.gadgets.system.AbstractResource
com.atlassian.jira.gadgets.system.RoadMapResource
@Path("roadmap")
@Produces("application/json")
public class RoadMapResource
extends AbstractResource
REST endpoint to retrieve a list of unreleased versions, according to the input criteria. It also provides a REST
endpoint to validate the input criteria to make sure specified projects exist, etc.
- Since:
- v7.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Contains the data of a project a version belongs to, including: The id of the project The project key The project namestatic class
The data structure of statistics on resolved/unresolved, with jql clause used to retrieve the set of the issues.static class
The data structure of the road map generated by theRoadMapResource
.static class
The data structure of a project version contained in the road map data. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRoadMapResource
(JiraAuthenticationContext authCtx, PermissionManager permissionManager, InternalProjectPermissionHelper projectPermissionHelper, ProjectManager projectManager, VersionManager versionManager, SearchService searchService, MauEventService mauEventService, VelocityRequestContextFactory velocityRequestContextFactory, DateTimeFormatter dateTimeFormatter, ApplicationProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptionfilterProjectCategoryIds
(Collection<String> projectOrCategoryIds) Filter project category ids from the given collection.filterProjectIds
(Collection<String> projectOrCategoryIds) Filter project ids from the given collection.javax.ws.rs.core.Response
Generates the road map data based on the given parameters.boolean
javax.ws.rs.core.Response
Validates the given configuration.Methods inherited from class com.atlassian.jira.gadgets.system.AbstractResource
createErrorResponse, createIndexingUnavailableResponse, createValidationResponse
-
Field Details
-
ALL_PROJECTS
- See Also:
-
DEFAULT_DAYS_MAX_INCL
public static final int DEFAULT_DAYS_MAX_INCL- See Also:
-
DEFAULT_NUM_MAX_INCL
public static final int DEFAULT_NUM_MAX_INCL- See Also:
-
-
Constructor Details
-
RoadMapResource
@Inject public RoadMapResource(JiraAuthenticationContext authCtx, PermissionManager permissionManager, InternalProjectPermissionHelper projectPermissionHelper, ProjectManager projectManager, VersionManager versionManager, SearchService searchService, MauEventService mauEventService, VelocityRequestContextFactory velocityRequestContextFactory, DateTimeFormatter dateTimeFormatter, ApplicationProperties applicationProperties)
-
-
Method Details
-
validate
@GET @Path("/validate") public javax.ws.rs.core.Response validate(@QueryParam("projectsOrCategories") String projectsOrCategories, @QueryParam("days") @DefaultValue("30") String days, @QueryParam("num") @DefaultValue("10") String num) Validates the given configuration.- Parameters:
projectsOrCategories
- the ids of all selected projects and project categories, concatenated by pipe symbole (|). A special id value of "allprojects" indicates all projects are selected. Project ids must be numeric; otherwise, the id is ignored. Category ids must be numeric and prefixed by "cat"; otherwise, the id is ignored. If none is selected or one of the selecte projects/categories does not exist, a validate error is returned in the response.days
- the number of days to cover. If zero, only overdue versions will be returned. Must not be negative. If negative or non-numeric, a validation error is returnednum
- the maximum number of results. Must be positive. if negative, zero or non-numeric, a validation error is returned- Returns:
- a response with status code 200 if validation passes or with status code 400 if fail, in which case, validation errors are included in the response
-
generate
@GET @Path("/generate") public javax.ws.rs.core.Response generate(@QueryParam("projectsOrCategories") String projectsOrCategories, @QueryParam("days") @DefaultValue("30") int days, @QueryParam("num") @DefaultValue("10") int num) Generates the road map data based on the given parameters.- Parameters:
projectsOrCategories
- the ids of all selected projects and project categories, concatenated by pipe symbole (|). A special id value of "allprojects" indicates all projects are selected. Project ids must be numeric; otherwise, the id is ignored. Category ids must be numeric and prefixed by "cat"; otherwise, the id is ignored.days
- the number of days to cover. If zero, only overdue versions will be returned. Must not be negative.num
- the maximum number of results. Must be positive.- Returns:
- a response with status code 200 containing
RoadMapResource.RoadMapData
. If there is an error in the processing, a response with status code 500 is returned
-
isOverdue
-
filterProjectIds
Filter project ids from the given collection. Returns a set of project ids as Long objects. Value is a valid project id if it is a long number.- Parameters:
projectOrCategoryIds
- collection of project or category ids- Returns:
- set of project ids, never null
-
filterProjectCategoryIds
Filter project category ids from the given collection. Returns a set of project category ids as Long objects. Value is a valid category if it takes form "catXYZ" where "cat" is the prefix (CATEGORY
) and XYZ is a long number.- Parameters:
projectOrCategoryIds
- collection of project or category ids- Returns:
- set of project category ids, never null
-