Example scripts
To homepage
Jira

Change Epic Status Field When Resolution Gets Set
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
groovy
def eventIssue = Issues.getByKey(issue.key as String)
def resolutionChange = changelog.items.find {
(it as Map).field == 'resolution'
} as Map
logger.info("The resolution change of issue '${eventIssue.key}': ${resolutionChange}.")
def newEpicStatusValue = (resolutionChange?.toString == 'Done') ? 'Done' : 'To Do'
logger.info("The epic status value is: ${newEpicStatusValue}.")
if (!resolutionChange) {
logger.info("The resolution didn't change.")
return
}
logger.info("Updating Epic Status field Epic Status to '${newEpicStatusValue}'.")
eventIssue.update{
setCustomFieldValue('Epic Status', newEpicStatusValue)
}
Having an issue with this script?
Report it here