public class

VersionResource

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

Summary

Public Constructors
VersionResource(VersionService versionService, ProjectService projectService, JiraAuthenticationContext authContext, I18nHelper i18n, RemoteVersionLinkResource remoteVersionLinkResource, VersionBeanFactory versionBeanFactory, VersionIssueCountsBeanFactory versionIssueCountsBeanFactory, VersionUnresolvedIssueCountsBeanFactory versionUnresolvedIssueCountsBeanFactory, DateFieldFormat dateFieldFormat, EventPublisher eventPublisher)
Public Methods
Response createOrUpdateRemoteVersionLink(String versionId, String globalId, String json)
Create a remote version link via POST using the provided global ID.
Response createOrUpdateRemoteVersionLink(String versionId, String json)
Create a remote version link via POST.
Response createVersion(VersionBean bean)
Create a version via POST.
Response delete(String id, String moveFixIssuesTo, String moveAffectedIssuesTo)
Delete a project version.
Response deleteRemoteVersionLink(String versionId, String globalId)
Delete a specific remote version link with the given version ID and global ID.
Response deleteRemoteVersionLinksByVersionId(String versionId)
Delete all remote version links for a given version ID.
Response getRemoteVersionLink(String versionId, String globalId)
A REST sub-resource representing a remote version link
Response getRemoteVersionLinks(String globalId)
Returns the remote version links for a given global ID.
Response getRemoteVersionLinksByVersionId(String versionId)
Returns the remote version links associated with the given version ID.
Response getVersion(String id, String expand)
Returns a project version.
Response getVersionRelatedIssues(String id)
Returns a bean containing the number of fixed in and affected issues for the given version.
Response getVersionUnresolvedIssues(String id)
Returns the number of unresolved issues for the given version
Response moveVersion(String id, VersionMoveBean bean)
Modify a version's sequence within a project.
Response updateVersion(String id, VersionBean bean)
Modify a version via PUT.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public VersionResource (VersionService versionService, ProjectService projectService, JiraAuthenticationContext authContext, I18nHelper i18n, RemoteVersionLinkResource remoteVersionLinkResource, VersionBeanFactory versionBeanFactory, VersionIssueCountsBeanFactory versionIssueCountsBeanFactory, VersionUnresolvedIssueCountsBeanFactory versionUnresolvedIssueCountsBeanFactory, DateFieldFormat dateFieldFormat, EventPublisher eventPublisher)

Public Methods

public Response createOrUpdateRemoteVersionLink (String versionId, String globalId, String json)

Create a remote version link via POST using the provided global ID.

public Response createOrUpdateRemoteVersionLink (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.

public Response createVersion (VersionBean bean)

Create a version via POST.

public Response delete (String id, String moveFixIssuesTo, String moveAffectedIssuesTo)

Delete a project version.

Parameters
id The version to delete
moveFixIssuesTo The version to set fixVersion to on issues where the deleted version is the fix version, If null then the fixVersion is removed.
moveAffectedIssuesTo The version to set affectedVersion to on issues where the deleted version is the affected version, If null then the affectedVersion is removed.
Returns
  • An empty or error response.

public Response deleteRemoteVersionLink (String versionId, 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.

public Response deleteRemoteVersionLinksByVersionId (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.

public Response getRemoteVersionLink (String versionId, 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.

Remote version links follow the same general rules that Issue Links do, except that they are permitted to use any arbitrary well-formed JSON data format with no restrictions imposed. It is recommended, but not required, that they follow the same format used for Remote Issue Links, as described at https://developer.atlassian.com/display/JIRADEV/Fields+in+Remote+Issue+Links.

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.

public Response getRemoteVersionLinks (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

public Response getRemoteVersionLinksByVersionId (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

public Response getVersion (String id, String expand)

Returns a project version.

Parameters
id a String containing the version id
Returns
  • a project version

public Response getVersionRelatedIssues (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

public Response getVersionUnresolvedIssues (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

public Response moveVersion (String id, VersionMoveBean bean)

Modify a version's sequence within a project.

The move version bean has 2 alternative field value pairs:

position
An absolute position, which may have a value of 'First', 'Last', 'Earlier' or 'Later'
after
A version to place this version after. The value should be the self link of another version

Parameters
id a String containing the version id
bean a MoveVersionBean that describes the move to be performed.
Returns
  • a project version

public Response updateVersion (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.