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

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

    • getVersion

      io.atlassian.util.concurrent.Promise<Version> getVersion(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

      io.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

      io.atlassian.util.concurrent.Promise<Version> updateVersion(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

      io.atlassian.util.concurrent.Promise<Void> removeVersion(URI versionUri, @Nullable URI moveFixIssuesToVersionUri, @Nullable 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

      io.atlassian.util.concurrent.Promise<VersionRelatedIssuesCount> getVersionRelatedIssuesCount(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

      io.atlassian.util.concurrent.Promise<Integer> getNumUnresolvedIssues(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

      io.atlassian.util.concurrent.Promise<Version> moveVersionAfter(URI versionUri, 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

      io.atlassian.util.concurrent.Promise<Version> moveVersion(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.)