Class VersionResource

java.lang.Object
com.atlassian.jira.rest.v2.issue.VersionResource

@Path("version") @Consumes("application/json") @Produces("application/json") public class VersionResource extends Object
Since:
4.2
  • Constructor Details

  • Method Details

    • getVersion

      @GET @Path("{id}") public jakarta.ws.rs.core.Response getVersion(@PathParam("id") String id, @QueryParam("expand") String expand)
      Returns a project version.
      Parameters:
      id - a String containing the version id
      Returns:
      a project version view it.
    • getPaginatedVersions

      @GET @Produces("application/json") @ExperimentalApi public jakarta.ws.rs.core.Response getPaginatedVersions(@QueryParam("startAt") @DefaultValue("0") long startAt, @QueryParam("maxResults") @DefaultValue("100") int maxResults, @QueryParam("query") @DefaultValue("") String query, @QueryParam("projectIds") Set<Long> projectIds)
      Retrieve paginated collection of versions matching given query optionally filtered by given project IDs.
      Parameters:
      startAt - optional index of the first version to return
      maxResults - optional maximum number of versions to return
      query - optional string that version names will be matched with
      projectIds - optional set of project IDs to filter versions with
      Since:
      9.2
    • updateVersion

      @PUT @Path("{id}") public jakarta.ws.rs.core.Response updateVersion(@PathParam("id") String id, VersionBean bean)
      Modify a version via PUT. Any fields present in the PUT will override existing values. As a convenience, if a field is not present, it is silently ignored.
    • createVersion

      @POST public jakarta.ws.rs.core.Response createVersion(VersionBean bean)
      Create a version via POST. view it.
    • delete

      @POST @Path("{id}/removeAndSwap") @Consumes("application/json") public jakarta.ws.rs.core.Response delete(@PathParam("id") String id, DeleteAndReplaceVersionBean parameters)
      Delete a project version, removed values will be replaced with ones specified by the parameters.
      Parameters:
      id - The version to delete
      parameters - specifies what version should replace given version in fields.
      Returns:
      An empty or error response. view it.
    • merge

      @PUT @Path("{id}/mergeto/{moveIssuesTo}") public jakarta.ws.rs.core.Response merge(@PathParam("id") String id, @PathParam("moveIssuesTo") String moveIssuesTo)
      Merge versions
      Parameters:
      id - The version that will be merged to version moveIssuesTo and removed
      moveIssuesTo - The version to set fixVersion to on issues where the deleted version is the fix version, If null then the fixVersion is removed.
      Returns:
      An empty or error response. view it.
    • getVersionRelatedIssues

      @GET @Path("{id}/relatedIssueCounts") public jakarta.ws.rs.core.Response getVersionRelatedIssues(@PathParam("id") String id)
      Returns a bean containing the number of fixed in and affected issues for the given version.
      Parameters:
      id - a String containing the version id
      Returns:
      an issue counts bean view it.
    • getVersionUnresolvedIssues

      @GET @Path("{id}/unresolvedIssueCount") public jakarta.ws.rs.core.Response getVersionUnresolvedIssues(@PathParam("id") String id)
      Returns the number of unresolved issues for the given version
      Parameters:
      id - a String containing the version id
      Returns:
      an unresolved issue count bean view it.
    • moveVersion

      @POST @Path("/{id}/move") public jakarta.ws.rs.core.Response moveVersion(@PathParam("id") String id, VersionMoveBean bean)
      Modify a version's sequence within a project.
      Parameters:
      id - a String containing the version id
      bean - a MoveVersionBean that describes the move to be performed.
      Returns:
      a project version
    • getRemoteVersionLinks

      @GET @Path("remotelink") public jakarta.ws.rs.core.Response getRemoteVersionLinks(@QueryParam("globalId") String globalId)
      Returns the remote version links for a given global ID.
      Parameters:
      globalId - the global ID of the remote resource that is linked to the versions
      Returns:
      a remote version link
    • getRemoteVersionLinksByVersionId

      @GET @Path("{versionId}/remotelink") public jakarta.ws.rs.core.Response getRemoteVersionLinksByVersionId(@PathParam("versionId") String versionId)
      Returns the remote version links associated with the given version ID.
      Parameters:
      versionId - a String containing the version ID
      Returns:
      the remote links for that project version view it.
    • getRemoteVersionLink

      @GET @Path("{versionId}/remotelink/{globalId}") public jakarta.ws.rs.core.Response getRemoteVersionLink(@PathParam("versionId") String versionId, @PathParam("globalId") String globalId)
      A REST sub-resource representing a remote version link
      Parameters:
      versionId - a String containing the version id
      globalId - The id of the remote issue link to be returned. If null (not provided) all remote links for the issue are returned.
      Returns:
      if no globalId is specified, a Response containing a RemoteEntityLinksJsonBeans is returned. Otherwise, a Response containing a RemoteEntityLinkJsonBean with the given globalId is returned.
    • createOrUpdateRemoteVersionLink

      @POST @Path("{versionId}/remotelink") public jakarta.ws.rs.core.Response createOrUpdateRemoteVersionLink(@PathParam("versionId") String versionId, String json)
      Create a remote version link via POST. The link's global ID will be taken from the JSON payload if provided; otherwise, it will be generated. view it.
    • createOrUpdateRemoteVersionLink

      @POST @Path("{versionId}/remotelink/{globalId}") public jakarta.ws.rs.core.Response createOrUpdateRemoteVersionLink(@PathParam("versionId") String versionId, @PathParam("globalId") String globalId, String json)
      Create a remote version link via POST using the provided global ID.
    • deleteRemoteVersionLinksByVersionId

      @DELETE @Path("{versionId}/remotelink") public jakarta.ws.rs.core.Response deleteRemoteVersionLinksByVersionId(@PathParam("versionId") String versionId)
      Delete all remote version links for a given version ID.
      Parameters:
      versionId - The version for which to delete ALL existing remote version links
      Returns:
      An empty or error response.
    • deleteRemoteVersionLink

      @DELETE @Path("{versionId}/remotelink/{globalId}") public jakarta.ws.rs.core.Response deleteRemoteVersionLink(@PathParam("versionId") String versionId, @PathParam("globalId") String globalId)
      Delete a specific remote version link with the given version ID and global ID.
      Parameters:
      versionId - The version ID of the remote link
      globalId - The global ID of the remote link
      Returns:
      An empty or error response.