getIssueHistory
Syntax | api.issue.getIssueHistory(issue) | Category | issue |
Description
Retrieve the change history for an issue.
Parameters
Parameter name | Type | Required | Description |
|---|---|---|---|
issue | Object | Yes | Issue object The issue of interest. For the current issue, use |
Returns
Returns a Promise to the value; you must use await.
Returns an array of zero or more IssueChange objects; each IssueChange object includes an array of zero or more IssueChangeItems.
Note: When an issue is updated from the issue screen (or other Jira screens), it will usually only include a single IssueChangeItem. However, when an issue is updated programmatically, multiple fields or attributes can be updated at once, resulting in several IssueChangeItems included.
interface IssueChange {
id: string
author: {
displayName: string
accountId: string
accountType: string
}
created: string
items: IssueChangeItem[]
}
interface IssueChangeItem {
field: string
fieldId: string
fieldtype: 'jira' | 'custom'
from: string
fromString: string
to: string
toString: string
} Examples
Return a list of all recent changelog entries.
const changes = await api.issue.getIssueHistory(issue)
return changes.map((change)=>change.items.map((item)=>`${item.field} changed from ${item.fromString} to ${item.toString} by ${change.author.displayName}`)).flat()You are viewing the documentation for Jira Cloud.
Determining custom field IDs
There are several ways to determine the field ID of a custom field; the most straightforward is to check the URL of the custom field when editing its details through the Jira Custom fields screen. To find the ID of a custom field:
Log into Jira as an Administrator.
In the upper right corner of the window, click Settings ( ) and select Issues.
In the left-hand sidebar, click Custom fields.
Locate your custom field in the list; use the filter at the top of the list to search.
Click the action button at the far right ( ) and select Edit details.
Check the URL for the page that opens - the final argument of the URL is the field ID (Figure 1, right).
Append this value to “customfield_” to get the full ID of the field. For example,
customfield_10130is the field ID of Projected Due Date, shown in the figure immediately right.
Need support? Create a request with our support team.
Copyright © 2005 - 2026 Appfire | All rights reserved.
