getFields

Description

Get the value of a a set of fields for the given Jira issue.

Parameters

Returns

Returns a Promise to the value; you must use await.

Returns an array of values, each of their own data type.

Examples

Get the Affects versions and Fix versions of the issue.

const vers = await api.issue.getFields(issue, ["versions","fixVersions"]) return json.stringify(vers)

Returns:

{"versions": [ { "self":"https://api.atlassian.com/ex/jira/<id>/rest/api/2/version/10001", "id":"10001", "description":"", "name":"2.0", "archived":false, "released":false }, { "self":"https://api.atlassian.com/ex/jira/<id>/rest/api/2/version/10002", "id":"10002", "description":"", "name":"1.9", "archived":false, "released":true, "releaseDate":"2024-09-24" } ], "fixVersions": [ { "self":"https://api.atlassian.com/ex/jira/<id>/rest/api/2/version/10000", "id":"10000", "description":"", "name":"2.1", "archived":false, "released":false } ] }

Get the Labels and Components of the issue’s Parent.

const parentIssue = await api.issue.getParentIssue(issue) const assignedTo = await api.issue.getFields(parentIssue, ["labels","components"]) return json.stringify(assignedTo)

Returns:

You are viewing the documentation for Jira Cloud.

Determining custom field IDs