To ensure that the data being shared out of Cherwell and into ServiceNow (inbound data) is being mapped correctly when arriving at your ServiceNow instance, you will next need to add and update some of the scripts in the PSP Common Incident to Incident transform map under the PSP Common Transform Maps module. ServiceNow transform maps handle the format of data being shared into a ServiceNow instance. Making changes to the transform map scripts will allow data to be properly shared out of Cherwell and then be mapped correctly to the relevant fields in ServiceNow.


Prerequisites


(warning) First, you will need to create a ServiceNow dynamic share for Cherwell.

(warning) You will also need to create a ServiceNow subscribed queue for Cherwell.

(warning) Then you will need to edit ServiceNow outbound table map fields for Cherwell.

Procedure

To add and edit the PSP Common Incident to Incident transform map scripts for Cherwell, follow these steps:



Access the PSP Common Incident to Incident transform map

Log into your ServiceNow instance and navigate to System Import Sets > Administration > Transform Maps or simply type and then select Transform Maps in the Filter Navigator on the upper left-hand side of the screen. Then, search for and then click into the PSP Common Incident to Incident transform map.

Edit the transform map fields

Scroll down to the tabs at the bottom of the form and click the Field Maps tab. In the list of Field Maps, search for and click into the following fields and modify them with their respective scripts.


Target FieldScript
state
answer = (function transformEntry(source) {
if (target.state == 7 || target.state == 8) {
return target.state;
}
if (source.u_state == "Resolved") {
return 6;
}
if (target.state == 3) {
return target.state;
}
switch (String(source.u_state)) {
case "New":
return 1;
case "In Progress":
return 2;
case "Resolved":
return 6;
case "Reopened":
if (target.state == 6) {
return 2;
} else {
return target.state;
}
break;
default:
return target.state;
}
})(source);
impact
answer = (function transformEntry(source) {
if (String(source.u_action) == "bulk_related" ||
String(source.u_impact) == "" ||
String(source.u_urgency) == "" ||
String(source.u_priority) == "") {
return target.impact;
}
switch (String(source.u_impact)) {
case "Individual":
return 3;
case "Department":
return 2;
case "Company":
return 1;
default:
return 3;
}
})(source);
urgency
answer = (function transformEntry(source) {
if (String(source.u_action) == "bulk_related" ||
String(source.u_impact) == "" ||
String(source.u_urgency) == "" ||
String(source.u_priority) == "") {
return target.urgency;
}
switch (String(source.u_urgency)) {
case "High":
return 1;
case "Medium":
return 2;
case "Low":
return 3;
default:
return 3;
}
})(source);