Originally asked by Jonathan Gilbert on 14 January 2021 (original question)
In our ServiceNow instance we have a list of various options to choose from when a ticket is put on hold.
I have copied the script from the help guides, which does update the status from Jira, but how can I also include the abilty to set the value on my additional field?.
What I would like is that if a ticket is put to “Backlog” in Jira, it sets ServiceNow to On Hold and “Awaiting Release”
def statusMap = [
// “remote status name”: “local status name”
“Backlog” : “On Hold”,
“To Do” : “On Hold”,
“In Progress” : “In Progress”,
“Done” : “Resolved”
]
def remoteStatusName = replica.status.name
issue.setStatus(statusMap[remoteStatusName] ?: remoteStatusName)
Her