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

Prerequisites


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

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 = "cf_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 = “cf_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 2 additional scripts as indicated below:

Source FieldScript to add
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) NOTEThe field mappings for priority and state are suggestions. The values assigned to answer in the script above can be changed to create custom mappings for these fields.Finally, click Update to save your changes to the table map.

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];freshdesk_sent;skip_insert;limit 1} click the icon to save your changes.


Next steps


Update ServiceNow transform map field scripts for Freshdesk