Example scripts
To homepage
Jira

Update the Labels for an Issue in Jira
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira (8.0 - 8.19)

ScriptRunner For Jira (7.10.0)
Language |
groovy
// you can set labels on creation/transition
def issue = Issues.create('SR', 'Task') {
setSummary('Help me!')
setLabels('first-label', 'second-label')
}
// you can *add* labels like this (using the syntax above would overwrite all labels)
issue = issue.update {
setLabels {
add('my-label')
}
}
// you can also *remove* or *replace* labels
issue.update {
setLabels {
remove('first-label')
replace('some-label', 'another-label')
}
}
Having an issue with this script?
Report it here