getFieldHistory

Description

Retrieve the change history for a particular field of an issue.

Parameters

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 for the Status field.

const statusChanges = await api.issue.getFieldHistory(issue, 'status'') return statusChanges.map((change)=>change.items.map((item)=>`status changed from ${item.fromString} to ${item.toString} by ${change.author.displayName}`)).flat()

You are viewing the documentation for Jira Cloud.

Determining custom field IDs