How to save Configuration Item (CI) from Jira SD in ServiceNow?

Originally asked by Andrew on 23 February 2021 (original question)


Hello Community,

I have following INC payload coming from Jira SD:

“customKeys”: {

“CI”: “abo20001”

},

CI record with above name (“abo20001”) exists on SN side, and I would like to store it on a INC record in SN. My incoming script for it looks as below:

if (replica.customFields.“customKeys”?.CI != null)

{

def remote\_CI \= replica.customFields."customKeys"?.CI

incident.description \= remote\_CI

incident.cmdb\_ci \= nodeHelper.getReference("cmdb\_ci", "cmdb\_ci", replica.customFields."customKeys"?.CI)

}

For test reason, temporary I would like to store “CI” in description and cmdb_ci fields, but none of this works.

Please suggest right solution


Answer by Andrew on 02 March 2021

After analyzing outgoing script from, ServiceNow incoming script has been modified and it works:

incident.cmdb_ci = nodeHelper.getReference(“cmdb_ci”, “name”, replica.“customKeys”?.CI)?.sys_id


This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.