You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

To ensure that the data being shared out of Zendesk 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 transform maps 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 Zendesk and then be mapped correctly to the relevant fields in ServiceNow.


Procedure

To add and edit the transform map scripts for Zendesk, follow these steps:


Access the transform map

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

TableTransform Map
Incident

PSP Common Incident to Incident

Add and update field maps 

The transform maps comes with default mappings you can modify as needed. 

By default, Zendesk does not provide display names for user fields such as the person who was assigned a ticket. Instead, it will be mapped with their ID such as:

<assigned_to_name>7603423341591</assigned_to_name>

So in this case you will want to map this value in the field map to a corresponding value for a user in ServiceNow.

Click Update to save your changes.

(Optional) Add a comment when a ticket is successfully created in Zendesk


When the Zendesk meshlet creates a new ticket in Zendesk, it will send back a .correlate message that ServiceNow can consume and add a comment to the incident. For example, you can create an onAfter transform script on the PSP Common Incident to Incident transform map with the following code to log the ID of the record in Zendesk:  

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {

	// Add your code here
	if (source.u_action == 'correlate') {
		gs.log("correlation");
		var igr = new GlideRecord('incident');
		igr.query('sys_id', source.u_correlation_id);
		if (igr.next()) {
			gs.log("found record");
			igr.comments.setJournalEntry('Record successfully created in Zendesk with ID ' + source.u_sys_id);
			//igr.setWorkflow(false);
			igr.update();
		}
	}
})(source, map, log, target);
  • No labels