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


Prerequisites


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

(warning) You will also need to create a ServiceNow subscribed queue for Autotask and edit ServiceNow outbound table map fields for Autotask.

Procedure

To add and edit the PSP Common Incident to Incident transform map scripts for Autotask, 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 onAfter script with Order 110

Scroll down to the tabs at the bottom of the form and click the Transform Scripts tab. In the list of Transform Scripts, search for and click into the onAfter script with an Order of 110. Scroll down to the scripting window and replace "msp_client_incident_sent" with "_sent"

Finally, click Update in the bottom left-hand corner of the form to save the changes to your transform map script.

WhenOrderScript
OnAfter100

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

var qgr = new GlideRecord("u_psp_queues");
var queue = "";
qgr.addQuery("u_name", "psp.in.meshlet.autotask");
qgr.query();
if (!qgr.next()){
return;
}

queue = qgr.sys_id;
var qc = new GlideRecord("psp_replicate_conf");
qc.addQuery("table_name", "incident");
qc.addQuery("u_target_queue", qgr.sys_id);
qc.query();
if (!qc.next()){
return;
}

var gr = new GlideRecord("incident");
gr.addQuery("sys_id", target.sys_id);
gr.query();
if (gr.next()){
var pspR = new PerspectiumReplicator();
pspR.shareRecord(gr, "incident", "update", qc.sys_id, "cipher=3,SIAM_provider=servicenow");
}
})(source, map, log, target);



Next steps


Add ServiceNow attachment.uploaded script action for Autotask