Table maps handle how data being shared out of ServiceNow is processed. Your outbound table map for Cherwell is the Incident to Common Incident table map, which will require some field changes to ensure that data is mapped correctly when sent from ServiceNow to Cherwell.

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.

Procedure

To edit the outbound table map fields for Cherwell, follow these steps:


Access the Incident to Common Incident outbound table map

Log into your ServiceNow instance and navigate to Perspectium > Control and Configuration > Table Maps or simply type and then select Table Maps in the Filter Navigator on the upper left-hand side of the screen. Then, search for and then click into the Incident to Common Incident table map. You can easily search for this table map by typing Incident to Common Incident in the search window under the Name field.

Add scripts for additional table map fields

Using Step #3 as a guide, click into and then add Source Scripts for the table map fields per the information in the table shown below.

Table Map Target FieldScript to add
contact_type
switch(String(current.contact_type)) {
case "email":
answer = "E-mail";
break;
case "phone":
answer = "Phone";
break;
case "walk-in":
answer = "Walk in";
break;
default:
// Default case if Walk in
answer = "Walk in";
break;
}
customer_id
//This should be the Business Object Id of the user in Cherwell
answer = "93d5c24854c6b87facbb97463a9f33bfee00ab3728";
comments
if(current.comments.changes()) {
answer = current.comments.getJournalEntry(1).replace(/[\r\n]+/g,"\\r\\n ");
} else {
answer = "";
}
category
// This field must be a valid field that exist in Cherwell. 
// Otherwise send over empty value to avoid issues
answer = "";
state
switch (Number(current.state)) {
case 1:
answer = "New";
break;
case 2:
case 3:
answer = "In Progress";
break;
case 6:
case 7:
case 8:
answer = "Resolved";
break;
default:
answer = "New";
break;
}
impact
switch(String(current.impact)) {
case '1':
answer = "Company";
break;
case '2':
answer = "Department";
break;
case '3':
answer = "Individual";
break;
default:
answer = "Individual";
break;
}
urgency
switch(String(current.urgency)) {
case '3':
answer = "Low";
break;
case '2':
answer = "Medium";
break;
case '1':
answer = "High";
break;
default:
answer = "Low";
break;
}




Next steps


Add and edit ServiceNow transform map scripts for Cherwell