Example scripts
To homepage
Jira

Copy Labels from a Parent Issue to all Linked-issues
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
groovy
// Specify the Issue by key
def issue = Issues.getByKey("TEST-9");
String[] labels = issue.labels.collect{it.toString()}.toArray(new String[0]);
// Loop linked issue, outward links specifically
def successStatusByIssueKey = issue.getOutwardLinks().collect { linkedIssue ->
Issues.getByKey(linkedIssue.outwardIssue.key).update {
setLabels (labels)
}
linkedIssue.outwardIssue.key
}
successStatusByIssueKey ? "Labels successfully copied to issues: ${successStatusByIssueKey}. \nPlease see the 'Logs' tab for more information on what issues were updated." :
"No outward links found. No labels copied."
Having an issue with this script?
Report it here