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
  • Field Details

  • Constructor Details

  • 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 returned
      num - 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

      public boolean isOverdue(Version version)
    • filterProjectIds

      public static Set<Long> filterProjectIds(Collection<String> projectOrCategoryIds)
      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

      public static Set<Long> filterProjectCategoryIds(Collection<String> projectOrCategoryIds)
      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