Skip to main content
Book your demo
Example scripts
To homepage
Jira
Cloud icon
Cloud

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

Features
Behaviours
Tags
Created 2 year(s) ago, Updated 0 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
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