Example scripts
To homepage
Jira

Access fields from the work item object in Behaviours for Jira Cloud
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
typescript
// Access the context for the UI Modification
const context = await getContext()
// Get the current work item key
const workItemKey = context.extension.issue.key;
// Get the current work item object
const workItem = await makeRequest("/rest/api/2/issue/" + workItemKey);
// Log out to the browser some field values to show how to get them from the work item.
// Note you can access any field on a work item through the fields property
console.log("Work item Field Values:")
console.log("Status field: ", workItem.body.fields.status)
console.log("Assignee field: ", workItem.body.fields.assignee)Having an issue with this script?
Report it here