Hi Team,
We would like to implement the below scenarios.
If the ticket priority is critical - automatically add a Priority1 to Label field. If the ticket is any other priority add a Priority2 value to Label field.
I have tried the below behavior using script runner, but the Label field is not updating with the values based on priority
import com.onresolve.jira.groovy.user.FieldBehaviours
import com.atlassian.jira.issue.priority.Priority
import groovy.transform.BaseScript
@BaseScript FieldBehaviours fieldBehaviours
if ((getFieldById(fieldChanged).value as Priority)?.name == 'Critical') {
getFieldById('Labels')
.setLabel('Priority1')
} else {
getFieldById('Labels')
.setLabel('Priority2')
}