Skip to main content
Home page
Example scripts
To homepage
Jira
Cloud icon
Cloud

Set the assignee field when the priority is set to High

Features
Behaviours
Created 2 year(s) ago, Updated 1 day(s) ago
App in script
ScriptRunner For Jira
ScriptRunner For Jira
by Adaptavist
Compatibility
compatibility bullet
Jira
Language |
typescript
// Get the field changed on the screen. 
const changedField = getChangeField();

// Specify below the AccountId of the user to assign the work item to.
const accountId = "123456-8545622-54522";

if (changedField.getName() === 'Priority') {

    const priorityName = changedField.getValue().name.toString();

    if (priorityName === "High") {
        getFieldById("assignee").setValue(accountId);
    } else {
        getFieldById("assignee").setValue(null);
    }
}
Having an issue with this script?
Report it here