Example scripts
To homepage
Jira

Update Multiple Fields
App in script

ScriptRunner For Jira
by Adaptavist
Compatibility

Jira
Language |
groovy
def eventIssue = Issues.getByKey(issue.key as String)
def toUpdate1CfId = "Custom Field 1"
def toUpdate2CfId = "Custom Field 2"
def toUpdate3CfId = "Custom Field 3"
def tomorrowStr = (new Date() + 1).format("yyyy-MM-dd'T'HH:mm:ssZ", TimeZone.getTimeZone("UTC")) // date format in iso8601
eventIssue.update{
setFixVersions("1.1")
setComponents("My Component")
setDescription("A generated description")
setCustomFieldValue(toUpdate1CfId, "Some text value")
setCustomFieldValue(toUpdate2CfId, tomorrowStr)
setCustomFieldValue(toUpdate3CfId, "admin")
}Having an issue with this script?
Report it here