Package com.atlassian.jira.rest.v2.issue
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 Summary
ConstructorsConstructorDescriptionVersionResource(VersionService versionService, ProjectService projectService, JiraAuthenticationContext authContext, I18nHelper i18n, RemoteVersionLinkResource remoteVersionLinkResource, VersionBeanFactory versionBeanFactory, VersionIssueCountsBeanFactory versionIssueCountsBeanFactory, VersionUnresolvedIssueCountsBeanFactory versionUnresolvedIssueCountsBeanFactory, DateFieldFormat dateFieldFormat, com.atlassian.event.api.EventPublisher eventPublisher) -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponsecreateOrUpdateRemoteVersionLink(String versionId, String json) Create a remote version link via POST.jakarta.ws.rs.core.ResponsecreateOrUpdateRemoteVersionLink(String versionId, String globalId, String json) Create a remote version link via POST using the provided global ID.jakarta.ws.rs.core.ResponsecreateVersion(VersionBean bean) Create a version via POST.jakarta.ws.rs.core.Responsedelete(String id, DeleteAndReplaceVersionBean parameters) Delete a project version, removed values will be replaced with ones specified by the parameters.jakarta.ws.rs.core.ResponsedeleteRemoteVersionLink(String versionId, String globalId) Delete a specific remote version link with the given version ID and global ID.jakarta.ws.rs.core.ResponsedeleteRemoteVersionLinksByVersionId(String versionId) Delete all remote version links for a given version ID.jakarta.ws.rs.core.ResponsegetPaginatedVersions(long startAt, int maxResults, String query, Set<Long> projectIds) Retrieve paginated collection of versions matching given query optionally filtered by given project IDs.jakarta.ws.rs.core.ResponsegetRemoteVersionLink(String versionId, String globalId) A REST sub-resource representing a remote version linkjakarta.ws.rs.core.ResponsegetRemoteVersionLinks(String globalId) Returns the remote version links for a given global ID.jakarta.ws.rs.core.ResponsegetRemoteVersionLinksByVersionId(String versionId) Returns the remote version links associated with the given version ID.jakarta.ws.rs.core.ResponsegetVersion(String id, String expand) Returns a project version.jakarta.ws.rs.core.ResponseReturns a bean containing the number of fixed in and affected issues for the given version.jakarta.ws.rs.core.ResponseReturns the number of unresolved issues for the given versionjakarta.ws.rs.core.ResponseMerge versionsjakarta.ws.rs.core.ResponsemoveVersion(String id, VersionMoveBean bean) Modify a version's sequence within a project.jakarta.ws.rs.core.ResponseupdateVersion(String id, VersionBean bean) Modify a version via PUT.
-
Constructor Details
-
VersionResource
@Inject public VersionResource(VersionService versionService, ProjectService projectService, JiraAuthenticationContext authContext, I18nHelper i18n, RemoteVersionLinkResource remoteVersionLinkResource, VersionBeanFactory versionBeanFactory, VersionIssueCountsBeanFactory versionIssueCountsBeanFactory, VersionUnresolvedIssueCountsBeanFactory versionUnresolvedIssueCountsBeanFactory, DateFieldFormat dateFieldFormat, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
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 returnmaxResults- optional maximum number of versions to returnquery- optional string that version names will be matched withprojectIds- 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
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 deleteparameters- 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 versionmoveIssuesToand removedmoveIssuesTo- 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 idbean- 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 idglobalId- The id of the remote issue link to be returned. Ifnull(not provided) all remote links for the issue are returned.- Returns:
- if no globalId is specified, a
Responsecontaining aRemoteEntityLinksJsonBeans is returned. Otherwise, a Response containing aRemoteEntityLinkJsonBeanwith the givenglobalIdis 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 linkglobalId- The global ID of the remote link- Returns:
- An empty or error response.
-