Example scripts
To homepage
Jira

Create Sub-tasks when an Issue is Created
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
groovy
def eventIssue = Issues.getByKey(issue.key as String)
if (eventIssue.issueType.subtask) { // If the newly created issue is a subtask, skip the execution
return
}
def listOfsummaries = ['Subtask summary 1', 'Subtask summary 2'] // The summaries to use for
def subtaskIssueType = 'Sub-task' // The Sub Task Issue Type to Use
def projectKey = eventIssue.getProjectObject().key
listOfsummaries.forEach { summary ->
eventIssue.createSubTask(subtaskIssueType) {
setSummary(summary)
}
}
Having an issue with this script?
Report it here