Class: IssueClient

IssueClient(jiraClient)

new IssueClient(jiraClient)

Used to access Jira REST endpoints in '/rest/api/2/issue' and '/rest/agile/1.0/issue'

Parameters:
Name Type Description
jiraClient JiraClient
Source:

Methods

(static) addAttachment(opts, callbackopt) → {Promise}

Add an attachments to an issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

filename string | Array.<string>

The file name of attachment. If you pass an array of filenames, multiple attachments will be added.

headers Object <optional>
callback function <optional>

Called when the attachment has been attached.

Source:
Returns:

Resolved when the attachment has been attached.

Type
Promise

addComment(opts, callbackopt) → {Promise}

Add a comment to an issue

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

expand string <optional>

Use expand to include additional information about comments in the response. This parameter accepts renderedBody, which returns the comment body rendered in HTML.

body string <optional>

The comment text

visibility string <optional>

The group or role to which this comment is visible. Optional on create and update.

properties string <optional>

A list of comment properties. Optional on create and update.

callback callback <optional>

Called when data has been retrieved

Source:
Returns:

Resolved when data has been retrieved

Type
Promise

addWatcher(opts, callbackopt) → {Promise}

Adds a user to an issue's watcher list.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

watcher string

The username of the user to add as a watcher.

callback <optional>

Called after the watcher is added.

Source:
Returns:

Resolved after the watcher is added.

Type
Promise

addWorkLog(opts, callbackopt) → {Promise}

Adds a new worklog entry to an issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

adjustEstimate string <optional>

Allows you to provide specific instructions to update the remaining time estimate of the issue. Valid values are * "new" - sets the estimate to a specific value * "leave"- leaves the estimate as is * "manual" - specify a specific amount to increase remaining estimate by * "auto"- Default option. Will automatically adjust the value based on the new timeSpent specified on the worklog

newEstimate string <optional>

(required when "new" is selected for adjustEstimate) the new value for the remaining estimate field. e.g. "2d"

reduceBy string <optional>

(required when "manual" is selected for adjustEstimate) the amount to reduce the remaining estimate by e.g. "2d"

callback <optional>

Called after the worklog is added.

Source:
Returns:

Resolved after the worklog is added.

Type
Promise

assignIssue(opts, callbackopt) → {Promise}

Assigns an issue to a user. You can use this resource to assign issues when the user submitting the request has the assign permission but not the edit issue permission. If the name is "-1" automatic assignee is used. A null name will remove the assignee. or You can use accountId of the user whom to assign the issue. See https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/

Parameters:
Name Type Attributes Description
opts Object

use assignee name or accountId to assign the issue

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

assignee string <optional>

The name of the user to whom to assign the issue

accountId string <optional>

The accountId of the user to whom to assign the issue. -1 for default, null for no assignee.

callback <optional>

Called when the issue has been assigned.

Source:
Returns:

Resolved when the issue has been assigned.

Type
Promise

bulkCreate(issues, callbackopt) → {Promise}

Creates issues or sub-tasks from a JSON representation.

Creates many issues in one bulk operation.

Creating a sub-task is similar to creating a regular issue. More details can be found in createIssue section: IssueResource#createIssue(IssueUpdateBean)}

Parameters:
Name Type Attributes Description
issues

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

callback <optional>

Called when the issues have been created.

Source:
Returns:

Resolved when the issues have been created.

Type
Promise

createIssue(issue, callbackopt) → {Promise}

Creates an issue or a sub-task from a JSON representation.

The fields that can be set on create, in either the fields parameter or the update parameter can be determined using the /rest/api/2/issue/createmeta resource. If a field is not configured to appear on the create screen, then it will not be in the createmeta, and a field validation error will occur if it is submitted.

Creating a sub-task is similar to creating a regular issue, with two important differences:

  • the issueType field must correspond to a sub-task issue type (you can use /issue/createmeta to discover sub-task issue types), and
  • you must provide a parent field in the issue create request containing the id or key of the parent issue.
Parameters:
Name Type Attributes Description
issue Object

The issue data in the form of POST body to the JIRA API. See https://docs.atlassian.com/jira/REST/latest/#d2e398

callback <optional>

Called when the issue has been created.

Source:
Returns:

Resolved when the issue has been created.

Type
Promise

Creates (or updates) a remote issue link from a JSON representation. If a globalId is provided and a remote issue link exists with that globalId, the remote issue link is updated. Otherwise, the remote issue link is created.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

remoteLink Object

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

callback <optional>

Called when the remote links are retrieved.

Source:
Returns:

Resolved when the remote links are retrieved.

Type
Promise

deleteComment(opts, callbackopt) → {Promise}

Delete an existing comment.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

commentId string

The id of the comment.

callback <optional>

Called when the comment is retrieved.

Source:
Returns:

Resolved when the comment is retrieved.

Type
Promise

deleteIssue(opts, callbackopt) → {Promise}

Delete an issue. If the issue has subtasks you must set the parameter deleteSubtasks=true to delete the issue. You cannot delete an issue without its subtasks also being deleted.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

deleteSubtasks string <optional>

"a String of true or false indicating that any subtasks should also be deleted. If the issue has no subtasks this parameter is ignored. If the issue has subtasks and this parameter is missing or false, then the issue will not be deleted and an error will be returned."

callback <optional>

Called when data has been retrieved

Source:
Returns:

Resolved when data has been retrieved

Type
Promise

Delete the remote issue link with the given global id on the issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

globalId string

The global id of the remote issue link

callback <optional>

Called when the remote links are retrieved.

Source:
Returns:

Resolved when the remote links are retrieved.

Type
Promise

deleteRemoteLinkById(opts, callbackopt) → {Promise}

Get the remote issue link with the given id on the issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

linkId string

The id of the remote link

callback <optional>

Called when the remote links are retrieved.

Source:
Returns:

Resolved when the remote links are retrieved.

Type
Promise

deleteWorkLog(opts, callbackopt) → {Promise}

Deletes an existing worklog entry

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

id string

The id of the work log to delete.

adjustEstimate string <optional>

Allows you to provide specific instructions to update the remaining time estimate of the issue. Valid values are * "new" - sets the estimate to a specific value * "leave"- leaves the estimate as is * "manual" - specify a specific amount to increase remaining estimate by * "auto"- Default option. Will automatically adjust the value based on the new timeSpent specified on the worklog

newEstimate string <optional>

(required when "new" is selected for adjustEstimate) the new value for the remaining estimate field. e.g. "2d"

increaseBy string <optional>

(required when "manual" is selected for adjustEstimate) the amount to reduce the remaining estimate by e.g. "2d"

callback <optional>

Called after the work log is deleted.

Source:
Returns:

Resolved after the work log is deleted.

Type
Promise

editComment(opts, callbackopt) → {Promise}

Updates an existing comment using its JSON representation.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

commentId string

The id of the comment.

comment Object

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

callback <optional>

Called when data has been retrieved

Source:
Returns:

Resolved when data has been retrieved

Type
Promise

editIssue(opts, callbackopt) → {Promise}

Edits an issue from a JSON representation.

The issue can either be updated by setting explicit the field value(s) or by using an operation to change the field value.

The fields that can be updated, in either the fields parameter or the update parameter, can be determined using the IssueClient#getEditMetadata method. If a field is not configured to appear on the edit screen, then it will not be in the editmeta, and a field validation error will occur if it is submitted.

Specifying a "field_id": field_value in the "fields" is a shorthand for a "set" operation in the "update" section. Field should appear either in "fields" or "update", not in both.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

notifyUsers boolean <optional>
overrideScreenSecurity boolean <optional>
overrideEditableFlag boolean <optional>
issue Object <optional>

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

Properties
Name Type Attributes Description
transition Object <optional>
fields Object <optional>
update Object <optional>
historyMetadata Object <optional>
properties Object <optional>
callback callback <optional>

Called when data has been retrieved

Source:
Returns:

Resolved when data has been retrieved

Type
Promise

getChangelog(opts, callbackopt) → {Promise}

Returns the list of changelogs for the issue with the given key.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

startAt string <optional>

Pagination startAt (default 0)

maxResults string <optional>

Pagination maxResults (default 100)

callback <optional>

Called after the changelog is retrieved.

Source:
Returns:

Resolved after the changelog is retrieved.

Type
Promise

getComment(opts, callbackopt) → {Promise}

Get a specific comment.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

commentId string

The id of the comment.

callback <optional>

Called when the comment is retrieved.

Source:
Returns:

Resolved when the comment is retrieved.

Type
Promise

getComments(opts, callbackopt) → {Promise}

Get all the comments for an issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

expand Object

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

callback <optional>

Called when the issue has been assigned.

Source:
Returns:

Resolved when the issue has been assigned.

Type
Promise

getCreateMetadata(optsopt, callbackopt) → {Promise}

Returns the meta data for creating issues. This includes the available projects, issue types and fields, including field types and whether or not those fields are required. Projects will not be returned if the user does not have permission to create issues in that project.

The fields in the createmeta correspond to the fields in the create screen for the project/issuetype. Fields not in the screen will not be in the createmeta.

Fields will only be returned if expand=projects.issuetypes.fields.

The results can be filtered by project and/or issue type, given by the query params.

Parameters:
Name Type Attributes Description
opts Object <optional>

The options for the API request.

Properties
Name Type Attributes Description
projectIds string <optional>

combined with the projectKeys param, lists the projects with which to filter the results. If absent, all projects are returned. This parameter can be specified multiple times, and/or be a comma-separated list. Specifiying a project that does not exist (or that you cannot create issues in) is not an error, but it will not be in the results.

projectKeys string <optional>

combined with the projectIds param, lists the projects with which to filter the results. If null, all projects are returned. This parameter can be specified multiple times, and/or be a comma-separated list. Specifiying a project that does not exist (or that you cannot create issues in) is not an error, but it will not be in the results.

issuetypeIds string <optional>

combinded with issuetypeNames, lists the issue types with which to filter the results. If null, all issue types are returned. This parameter can be specified multiple times, and/or be a comma-separated list. Specifiying an issue type that does not exist is not an error.

issuetypeNames string <optional>

combinded with issuetypeIds, lists the issue types with which to filter the results. If null, all issue types are returned. This parameter can be specified multiple times, but is NOT interpreted as a comma-separated list. Specifiying an issue type that does not exist is not an error.

expand string <optional>

in order to get expanded field descriptions, specify 'projects.issuetypes.fields' here.

callback <optional>

Called when the metadata has been retrieved.

Source:
Returns:

Resolved when the metadata has been retrieved.

Type
Promise

getEditMetadata(opts, callbackopt) → {Promise}

Returns the meta data for editing an issue.

The fields in the editmeta correspond to the fields in the edit screen for the issue. Fields not in the screen will not be in the editemeta.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

callback <optional>

Called when the metadata is retrieved.

Source:
Returns:

Resolved when the metadata is retrieved.

Type
Promise

getIssue(opts, callbackopt) → {Promise}

Returns a full representation of the issue for the given issue key.

An issue JSON consists of the issue key, a collection of fields, a link to the workflow transition sub-resource, and (optionally) the HTML rendered values of any fields that support it (e.g. if wiki syntax is enabled for the description or comments).

The fields param (which can be specified multiple times) gives a comma-separated list of fields to include in the response. This can be used to retrieve a subset of fields. A particular field can be excluded by prefixing it with a minus.

By default, all (*all) fields are returned in this get-issue resource. Note: the default is different when doing a jql search -- the default there is just navigable fields (*navigable).

  • *all - include all fields
  • *navigable - include just navigable fields
  • summary,comment - include just the summary and comments
  • -comment - include everything except comments (the default is *all for get-issue)
  • *all,-comment - include everything except comments

JIRA will attempt to identify the issue by the issueIdOrKey path parameter. This can be an issue id, or an issue key. If the issue cannot be found via an exact match, JIRA will also look for the issue in a case-insensitive way, or by looking to see if the issue was moved. In either of these cases, the request will proceed as normal (a 302 or other redirect will not be returned). The issue key contained in the response will indicate the current value of issue's key.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
agile boolean <optional>

Whether or not to call the agile version of this endpoint. Defaults to false.

issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

fields Object <optional>

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

expand Object <optional>

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

properties Object <optional>

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

callback <optional>

Called when data has been retrieved

Source:
Returns:

Resolved when data has been retrieved

Type
Promise

getIssueEstimation(opts, callbackopt) → {Promise}

Returns the estimation of the issue and a filedId of the field that is used for it. The boardId parameter is required, and determines which field will be updated on an issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

boardId string <optional>

The id of the board required to determine which field is used for estimation.

callback <optional>

Called when the issue estimation has been retrieved.

Source:
Returns:

Resolved when the issue estimation has been retrieved.

Type
Promise

getIssuePicker(opts, callbackopt) → {Promise}

Returns suggested issues which match the auto-completion query for the user which executes this request. This REST method will check the user's history and the user's browsing context and select this issues, which match the query.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API.

Properties
Name Type Attributes Description
query string <optional>

the query

currentJQL string <optional>

the JQL in context of which the request is executed. Only issues which match this JQL query will be included in results.

currentIssueKey string <optional>

the key of the issue in context of which the request is executed. The issue which is in context will not be included in the auto-completion result, even if it matches the query.

currentProjectId string <optional>

the id of the project in context of which the request is executed. Suggested issues will be only from this project.

showSubTasks boolean <optional>

if set to false, subtasks will not be included in the list.

showSubTaskParent boolean <optional>

if set to false and request is executed in context of a subtask, the parent issue will not be included in the auto-completion result, even if it matches the query.

callback <optional>

Called when the issues have been retrieved.

Source:
Returns:

Resolved when the issues have been retrieved.

Type
Promise

getProperties(opts, callbackopt) → {Promise}

Returns the keys of all properties for the issue identified by the key or by the id. This function is maked as experimental in the Jira API docs, use at your own risk.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

callback <optional>

Called when the properties are retrieved.

Source:
Returns:

Resolved when the properties are retrieved.

Type
Promise

getProperty(opts, callbackopt) → {Promise}

Returns the value of the property with a given key from the issue identified by the key or by the id. The user who retrieves the property is required to have permissions to read the issue.

This function is maked as experimental in the Jira API docs, use at your own risk.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

propertyKey string

The key of the property being set.

callback <optional>

Called when the property is retrieved.

Source:
Returns:

Resolved when the property is retrieved.

Type
Promise

getProperty(opts, callbackopt) → {Promise}

Removes the property from the issue identified by the key or by the id. Ths user removing the property is required to have permissions to edit the issue.

This function is maked as experimental in the Jira API docs, use at your own risk.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

propertyKey string

The key of the property being set.

callback <optional>

Called when the property is deleted.

Source:
Returns:

Resolved when the property is deleted.

Type
Promise

getRemoteLinkById(opts, callbackopt) → {Promise}

Get the remote issue link with the given id on the issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

linkId string

The id of the remote link

callback <optional>

Called when the remote links are retrieved.

Source:
Returns:

Resolved when the remote links are retrieved.

Type
Promise

Get a REST sub-resource representing the remote issue links on the issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

globalId string

The id of the remote issue link to be returned. If null (not provided) all remote links for the issue are returned. For a full explanation of Issue Link fields please refer to https://developer.atlassian.com/display/JIRADEV/Fields+in+Remote+Issue+Links

callback <optional>

Called when the remote links are retrieved.

Source:
Returns:

Resolved when the remote links are retrieved.

Type
Promise

getTransitions(opts, callbackopt) → {Promise}

Get a list of the transitions possible for this issue by the current user, along with fields that are required and their types.

Fields will only be returned if expand=transitions.fields.

The fields in the metadata correspond to the fields in the transition screen for that transition. Fields not in the screen will not be in the metadata.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

transitionId string

If specified, will call back with only the transition with the specified id.

callback <optional>

Called when the transitions are retrieved.

Source:
Returns:

Resolved when the transitions are retrieved.

Type
Promise

getVotes(opts, callbackopt) → {Promise}

Get a REST sub-resource representing the voters on the issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

callback <optional>

Called after the votes are retrieved.

Source:
Returns:

Resolved after the votes are retrieved.

Type
Promise

getWatchers(opts, callbackopt) → {Promise}

Returns the list of watchers for the issue with the given key.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

callback <optional>

Called after the watchers are retrieved.

Source:
Returns:

Resolved after the watchers are retrieved.

Type
Promise

getWorkLog(opts, callbackopt) → {Promise}

Gets a specific worklog.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

id string

The id of the work log to retrieve.

callback <optional>

Called after the worklog is retrieved.

Source:
Returns:

Resolved after the worklog is retrieved.

Type
Promise

getWorkLogs(opts, callbackopt) → {Promise}

Gets all work logs for an issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

callback <optional>

Called after the worklogs are retrieved.

Source:
Returns:

Resolved after the worklogs are retrieved.

Type
Promise

removeWatcher(opts, callbackopt) → {Promise}

Adds a user to an issue's watcher list.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

watcher string

The username of the user to remove as a watcher.

callback <optional>

Called after the watcher is removed.

Source:
Returns:

Resolved after the watcher is removed.

Type
Promise

sendEmailNotification(opts, callbackopt) → {Promise}

Sends a notification (email) to the list or recipients defined in the request. A couple of notes: this may call back with the error 'No recipients were defined for notification.' if all of the intended recipients have disabled notifications from Jira.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

notification Object

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

callback <optional>

Called when the metadata is retrieved.

Source:
Returns:

Resolved when the metadata is retrieved.

Type
Promise

setIssueEstimation(opts, callbackopt) → {Promise}

Updates the estimation of the issue. The boardId parameter is required, and determines which field will be updated on an issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
value string <optional>

The value to set the issue estimation as.

issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of teh issue. EX: JWR-3

boardId string <optional>

The id of the board required to determine which field is used for estimation.

callback <optional>

Called when the issue estimation has been created.

Source:
Returns:

Resolved when the issue estimation has been created.

Type
Promise

setIssueRanks(ranking, callbackopt) → {Promise}

Moves (ranks) issues before or after a given issue.

Parameters:
Name Type Attributes Description
ranking Object

The ranking data in the form of PUT body to the Jira API.

callback <optional>

Called when the issue rank has been created.

Source:
Returns:

Resolved when the issue rank has been created.

Type
Promise

setProperty(opts, callbackopt) → {Promise}

Sets the value of the specified issue's property. You can use this resource to store a custom data against the issue identified by the key or by the id. The user who stores the data is required to have permissions to edit the issue.

This function is maked as experimental in the Jira API docs, use at your own risk.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

propertyKey string

The key of the property being set.

propertyValue Object

The value of the property being set.

callback <optional>

Called when the property is set.

Source:
Returns:

Resolved when the property is set.

Type
Promise

transitionIssue(opts, callbackopt) → {Promise}

Perform a transition on an issue. When performing the transition you can udate or set other issue fields.

The fields that can be set on transtion, in either the fields parameter or the update parameter can be determined using the** /rest/api/2/issue/{issueIdOrKey}/transitions?expand=transitions.fields resource**. If a field is not configured to appear on the transition screen, then it will not be in the transition metadata, and a field validation error will occur if it is submitted.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

transition object <optional>

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

Properties
Name Type Attributes Description
id string <optional>

The ID of the issue transition. Required when specifying a transition to undertake.

callback <optional>

Called when the transitions are retrieved.

Source:
Returns:

Resolved when the transitions are retrieved.

Type
Promise

unvote(opts, callbackopt) → {Promise}

Remove your vote from an issue. (i.e. "unvote")

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

callback <optional>

Called after the vote is removed.

Source:
Returns:

Resolved after the vote is removed.

Type
Promise

Updates (or creates) a remote issue link from a JSON representation. If a globalId is provided and a remote issue link exists with that globalId, the remote issue link is updated. Otherwise, the remote issue link is created.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

remoteLink Object

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

callback <optional>

Called when the remote links are retrieved.

Source:
Returns:

Resolved when the remote links are retrieved.

Type
Promise

updateRemoteLinkById(opts, callbackopt) → {Promise}

Get the remote issue link with the given id on the issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

linkId string

The id of the remote link

remoteLink string

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

callback <optional>

Called when the remote links are retrieved.

Source:
Returns:

Resolved when the remote links are retrieved.

Type
Promise

updateWorkLog(opts, callbackopt) → {Promise}

Updates an existing worklog entry using its JSON representation.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

id string

The id of the work log to retrieve.

adjustEstimate string <optional>

Allows you to provide specific instructions to update the remaining time estimate of the issue. Valid values are * "new" - sets the estimate to a specific value * "leave"- leaves the estimate as is * "auto"- Default option. Will automatically adjust the value based on the new timeSpent specified on the worklog

newEstimate string <optional>

(required when "new" is selected for adjustEstimate) the new value for the remaining estimate field. e.g. "2d"

worklog Object

See {@link: https://docs.atlassian.com/jira/REST/latest/#d2e1161}

callback <optional>

Called after the worklog is updated.

Source:
Returns:

Resolved after the worklog is updated.

Type
Promise

vote(opts, callbackopt) → {Promise}

Cast your vote in favour of an issue.

Parameters:
Name Type Attributes Description
opts Object

The options to pass to the API. Note that this object must contain EITHER an issueId or issueKey property; issueId will be used over issueKey if both are present.

Properties
Name Type Attributes Description
issueId string <optional>

The id of the issue. EX: 10002

issueKey string <optional>

The Key of the issue. EX: JWR-3

callback <optional>

Called after the vote is removed.

Source:
Returns:

Resolved after the vote is removed.

Type
Promise