After creating a dynamic share for Freshservice, you will need to create custom fields for the Incident to Common Incident table map under the Table Maps module. Table maps handle how data being shared out of ServiceNow is processed. The custom table map fields to be added for your Freshservice service integration will ensure that the data sent of your ServiceNow instance is mapped properly to Freshservice ticket fields.

Prerequisites


(warning) You will first need to create a dynamic share for Freshservice.

Procedure


To create custom fields for the Incident to Common Incident table map , follow these steps:

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.

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.

Scroll down to the list of PSP Table Field Maps. Then, click New to create a new field.

Type CustomCorrelationID for the Source Field and @CustomCorrelationID for the Target Field. Then, check the Use Script box and add the following script in the scripting window:

answer = "correlation_id";

Finally, click Submit to finish creating your custom field.

Using Steps #3-4 as a guide, add 3 additional custom fields as indicated below:

Source FieldTarget FieldScript to add
CustomUpdatedVia@CustomUpdatedVia
answer = “updated_via”;
CustomUpdatedViaValue@CustomUpdatedViaValue
answer = “Webservice”;
if (!current.comments.nil()) {
answer = “Note”;
}
caller_id.emailcaller_email
answer = current.caller_id.email;

In the PSP Table Field Maps list, search for and click into the description field. Then, check the Use Script box and add the following script in the scripting window:

answer = current.description;
if (answer == "" || answer == null) {
answer = "None";

}

Finally, click Update to save your changes to the table map.

Using Step #6 as a guide, add 4 additional scripts as indicated below:

Source FieldScript to add
impact
answer = current.impact;
if (current.impact == '1') {
answer = '3';
}
else if (current.impact == '3') {
answer = '1';
}
urgency
answer = current.urgency;
if (current.urgency == '1') {
answer = '3';
}
else if (current.urgency == '3') {
answer = '1';
}
priority
if (current.priority == '1') {
answer = '4';
}
else if (current.priority == '2') {
answer = '3';
}
else if (current.priority == '3') {
answer = '2';
}
else {
answer = '1';
}
state
if (current.state == '2') { //Pending
answer = '3';
}
else if (current.state == '6') { //Resolved
answer = '4';
}
else if (current.state == '7') { //Closed
answer = '5';
}
else {
answer = '2';
}

(info) NOTE: The field mappings for impacturgencypriority, and state are suggestions. The values assigned to answer in the scripts above can be changed to create custom mappings for these fields.

In the PSP Table Field Maps list, locate and then double-click the ${TM:psp_attachment;table_sys_id=$[GR:sys_id];msp_client_sent;skip_insert} Source Field to edit the field (This will be the Source Field with attachments as the Target Field). Replace the field name with ${TM:psp_attachment;table_sys_id=$[GR:sys_id];freshservice_sent;skip_insert;limit 1} click the icon to save your changes.


Next steps


Update ServiceNow transform map field scripts for Freshservice