Originally asked by Andrew on 16 December 2020 (original question)
Hello,
I am having problem configure mapping in incoming script in ServiceNow for integer field (on-hold reason), while Jira is sending on-hold reason from text field.
Payload from Jira is below:
"11402": {
"id": 11402,
"name": "On hold reason",
"type": "OPTION",
"value": {
"id": 11871,
"sequence": 2,
"value": "Awaiting Vendor",
"disabled": false,
"childOptions": []
}
In incoming SN script I have tried this, but did not help:
def holdMapping = [
// Jira hold reason <-> SNOW hold reason
âAwaiting Changeâ : âAwaiting Changeâ
âAwaiting Vendorâ : âAwaiting Vendor**â**
]
def holdName = holdMapping[replica.customFields.âOn hold reasonâ?.name]
incident.hold_reason = holdName
ServiceNow hold_reason field is integer type and looks as below: