Class: VersionClient

VersionClient(jiraClient)

new VersionClient(jiraClient)

Used to access Jira REST endpoints in '/rest/api/2/version'

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

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.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
versionId

The version for which to retrieve unresolved issues.

remoteLink

See https://docs.atlassian.com/jira/REST/latest/#d2e3753

callback callback <optional>

Called when the remote link has been created.

Source:
Returns:

Resolved when the remote link has been created.

Type
Promise

createVersion(opts, callbackopt) → {Promise}

Creates a version

Parameters:
Name Type Attributes Description
opts Object

Details about a project version.

Properties
Name Type Attributes Description
version string <optional>

Body. See https://docs.atlassian.com/jira/REST/latest/#d2e3549

expand string <optional>
description string <optional>

The description of the version. Optional when creating or updating a version.

name string <optional>

The unique name of the version. Required when creating a version. Optional when updating a version. The maximum length is 255 characters.

archived boolean <optional>

Indicates that the version is archived. Optional when creating or updating a version.

released boolean <optional>

Indicates that the version is released. If the version is released a request to release again is ignored. Not applicable when creating a version. Optional when updating a version.

startDate string <optional>

The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a version.

releaseDate string <optional>

The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a version.

projectId number <optional>

The ID of the project to which this version is attached. Required when creating a version. Not applicable when updating a version.

moveUnfixedIssuesTo string <optional>

The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not applicable when creating a version. Optional when updating a version.

callback callback <optional>

Called when the version has been created.

Deprecated:
  • @param {string} [opts.project] Deprecated. Use projectId.
Source:
Returns:

Resolved when the version has been created.

Type
Promise

Delete all remote version links for a given version id.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
versionId string | number

The id of the version to delete.

callback callback <optional>

Called when the version is deleted.

Source:
Returns:

Resolved when the version is deleted.

Type
Promise

Delete a remote version link.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
versionId

The version id

remoteLinkId

The global id of the remote link

callback callback <optional>

Called when the link has been deleted.

Source:
Returns:

Resolved when the link has been deleted.

Type
Promise

deleteVersion(opts, callbackopt) → {Promise}

Delete a project version.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
versionId string | number

The id of the version to delete.

callback callback <optional>

Called when the version is deleted.

Source:
Returns:

Resolved when the version is deleted.

Type
Promise

editVersion(opts, callbackopt) → {Promise}

Modify an existing version; any omitted fields will be ignored.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to Jira.

Properties
Name Type Description
versionId string

The id of the version to edit.

version Object

See https://docs.atlassian.com/jira/REST/latest/#d2e3619

callback callback <optional>

Called when the version has been modified.

Source:
Returns:

Resolved when the version has been modified.

Type
Promise

getAllVersions(opts, callbackopt) → {Promise}

Get a all versions from specific board.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
boardId string | number

The id of the board which contains versions to retrieve.

callback callback <optional>

Called when all versions are retrieved.

Source:
Returns:

Resolved when all versions are retrieved.

Type
Promise

Returns the remote version links for a given global id.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
globalId

The global id of the remote resource that is linked to the versions

callback callback <optional>

Called when the remote link is returned.

Source:
Returns:

Resolved when the remote link is returned.

Type
Promise

getRelatedIssueCounts(opts, callbackopt) → {Promise}

Get a bean containing the number of fixed in and affected issues for the given version.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
versionId

The version for which to retrieve related issues.

callback callback <optional>

Called when the count has been retrieved.

Source:
Returns:

Resolved when the count has been retrieved.

Type
Promise

Get the remote version links associated with the given version id.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
versionId

The version for which to retrieve remote links.

callback callback <optional>

Called when the links have been retrieved.

Source:
Returns:

Resolved when the links have been retrieved.

Type
Promise

Get a REST sub-resource representing a remote version link.

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
versionId

The version for which to retrieve the remote link

remoteLinkId

The global id of the remote link

callback callback <optional>

Called when the link has been retrieved.

Source:
Returns:

Resolved when the link has been retrieved.

Type
Promise

getUnresolvedIssueCount(opts, callbackopt) → {Promise}

Get the number of unresolved issues for the given version

Parameters:
Name Type Attributes Description
opts

The request options sent to the Jira API.

Properties
Name Type Description
versionId

The version for which to retrieve unresolved issues.

callback callback <optional>

Called when the count has been retrieved.

Source:
Returns:

Resolved when the count has been retrieved.

Type
Promise

getVersion(opts, callbackopt) → {Promise}

Get a project version.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Description
versionId string | number

The id of the version to retrieve.

callback callback <optional>

Called when the version is retrieved.

Source:
Returns:

Resolved when the version is retrieved.

Type
Promise

moveVersion(opts, callbackopt) → {Promise}

Modify a version's sequence within a project. The move version bean has 2 alternative field value pairs (opts.position or opts.after). One and only one of these two must be provided.

Parameters:
Name Type Attributes Description
opts Object

The request options sent to the Jira API.

Properties
Name Type Attributes Description
versionId string

The id of the version to move.

position string <optional>

An absolute position, which may have a value of 'First', 'Last', 'Earlier' or 'Later'. Must be provided if opts.after is missing.

after string <optional>

A version to place this version after. The value should be the self link of another version. Must be provided if opts.position is missing

callback <optional>

Called when the version has been moved.

Source:
Returns:

Resolved when the version has been moved.

Type
Promise