com.atlassian.jira.rest.client
Interface VersionRestClient


public interface VersionRestClient

The client responsible for Project version(s) related operations

Since:
0.3 client, 4.4 server

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

Method Detail

getVersion

Version getVersion(URI versionUri,
                   ProgressMonitor progressMonitor)
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.
progressMonitor - progress monitor
Returns:
full information about selected project version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

createVersion

Version createVersion(VersionInput version,
                      ProgressMonitor progressMonitor)
Creates a new version (which logically belongs to a project)

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

updateVersion

Version updateVersion(URI versionUri,
                      VersionInput versionInput,
                      ProgressMonitor progressMonitor)
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
progressMonitor - progress monitor
Returns:
newly updated version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

removeVersion

void removeVersion(URI versionUri,
                   @Nullable
                   URI moveFixIssuesToVersionUri,
                   @Nullable
                   URI moveAffectedIssuesToVersionUri,
                   ProgressMonitor progressMonitor)
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.
progressMonitor - progress monitor
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

getVersionRelatedIssuesCount

VersionRelatedIssuesCount getVersionRelatedIssuesCount(URI versionUri,
                                                       ProgressMonitor progressMonitor)
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
progressMonitor - progress monitor
Returns:
basic stats about issues related to given version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

getNumUnresolvedIssues

int getNumUnresolvedIssues(URI versionUri,
                           ProgressMonitor progressMonitor)
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
progressMonitor - progress monitor
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

Version moveVersionAfter(URI versionUri,
                         URI afterVersionUri,
                         ProgressMonitor progressMonitor)
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
progressMonitor - progress monitor
Returns:
just moved version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)

moveVersion

Version moveVersion(URI versionUri,
                    VersionPosition versionPosition,
                    ProgressMonitor progressMonitor)
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
progressMonitor - progress monitor
Returns:
just moved version
Throws:
RestClientException - in case of problems (connectivity, malformed messages, etc.)


Copyright © 2011 Atlassian Pty Ltd. All Rights Reserved.