com.atlassian.jira.rest.client.api
Interface VersionRestClient


public interface VersionRestClient

The com.atlassian.jira.rest.client.api responsible for Project version(s) related operations

Since:
2.0 com.atlassian.jira.rest.client.api, 4.4 server

Method Summary
 com.atlassian.util.concurrent.Promise<Version> createVersion(VersionInput version)
          Creates a new version (which logically belongs to a project)
 com.atlassian.util.concurrent.Promise<java.lang.Integer> getNumUnresolvedIssues(java.net.URI versionUri)
          Retrieves number of unresolved issues which have their Fix Version(s) field pointing to given version.
 com.atlassian.util.concurrent.Promise<Version> getVersion(java.net.URI versionUri)
          Retrieves full information about selected project version
 com.atlassian.util.concurrent.Promise<VersionRelatedIssuesCount> getVersionRelatedIssuesCount(java.net.URI versionUri)
          Retrieves basic statistics about issues which have their Fix Version(s) or Affects Version(s) field pointing to given version.
 com.atlassian.util.concurrent.Promise<Version> moveVersion(java.net.URI versionUri, VersionPosition versionPosition)
          Moves selected version to another position.
 com.atlassian.util.concurrent.Promise<Version> moveVersionAfter(java.net.URI versionUri, java.net.URI afterVersionUri)
          Moves selected version after another version.
 com.atlassian.util.concurrent.Promise<java.lang.Void> removeVersion(java.net.URI versionUri, java.net.URI moveFixIssuesToVersionUri, java.net.URI moveAffectedIssuesToVersionUri)
          Removes selected version optionally changing Fix Version(s) and/or Affects Version(s) fields of related issues.
 com.atlassian.util.concurrent.Promise<Version> updateVersion(java.net.URI versionUri, VersionInput versionInput)
          Updates selected version with a new details.
 

Method Detail

getVersion

com.atlassian.util.concurrent.Promise<Version> getVersion(java.net.URI versionUri)
Retrieves full information about selected project version

Parameters:
versionUri - URI of the version to retrieve. You can get it for example from Project or it can be referenced from an issue.
Returns:
full information about selected project version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

createVersion

com.atlassian.util.concurrent.Promise<Version> createVersion(VersionInput version)
Creates a new version (which logically belongs to a project)

Parameters:
version - details about version to create
Returns:
newly created version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

updateVersion

com.atlassian.util.concurrent.Promise<Version> updateVersion(java.net.URI versionUri,
                                                             VersionInput versionInput)
Updates selected version with a new details.

Parameters:
versionUri - full URI to the version to update
versionInput - new details of the version. null fields will be ignored
Returns:
newly updated version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

removeVersion

com.atlassian.util.concurrent.Promise<java.lang.Void> removeVersion(java.net.URI versionUri,
                                                                    @Nullable
                                                                    java.net.URI moveFixIssuesToVersionUri,
                                                                    @Nullable
                                                                    java.net.URI moveAffectedIssuesToVersionUri)
Removes selected version optionally changing Fix Version(s) and/or Affects Version(s) fields of related issues.

Parameters:
versionUri - full URI to the version to remove
moveFixIssuesToVersionUri - URI of the version to which issues should have now set their Fix Version(s) field instead of the just removed version. Use null to simply clear Fix Version(s) in all those issues where the version removed was referenced.
moveAffectedIssuesToVersionUri - URI of the version to which issues should have now set their Affects Version(s) field instead of the just removed version. Use null to simply clear Affects Version(s) in all those issues where the version removed was referenced.
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

getVersionRelatedIssuesCount

com.atlassian.util.concurrent.Promise<VersionRelatedIssuesCount> getVersionRelatedIssuesCount(java.net.URI versionUri)
Retrieves basic statistics about issues which have their Fix Version(s) or Affects Version(s) field pointing to given version.

Parameters:
versionUri - full URI to the version you want to get related issues count for
Returns:
basic stats about issues related to given version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

getNumUnresolvedIssues

com.atlassian.util.concurrent.Promise<java.lang.Integer> getNumUnresolvedIssues(java.net.URI versionUri)
Retrieves number of unresolved issues which have their Fix Version(s) field pointing to given version.

Parameters:
versionUri - full URI to the version you want to get the number of unresolved issues for
Returns:
number of unresolved issues having this version included in their Fix Version(s) field.
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

moveVersionAfter

com.atlassian.util.concurrent.Promise<Version> moveVersionAfter(java.net.URI versionUri,
                                                                java.net.URI afterVersionUri)
Moves selected version after another version. Ordering of versions is important on various reports and whenever input version fields are rendered by JIRA. If version is already immediately after the other version (defined by afterVersionUri) then such call has no visual effect.

Parameters:
versionUri - full URI to the version to move
afterVersionUri - URI of the version to move selected version after
Returns:
just moved version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

moveVersion

com.atlassian.util.concurrent.Promise<Version> moveVersion(java.net.URI versionUri,
                                                           VersionPosition versionPosition)
Moves selected version to another position. If version already occupies given position (e.g. is the last version and we want to move to a later position or to the last position) then such call does not change anything.

Parameters:
versionUri - full URI to the version to move
versionPosition - defines a new position of selected version
Returns:
just moved version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)


Copyright © 2015 Atlassian. All Rights Reserved.