---
title: "Add and edit ServiceNow transform map scripts for Autotask"
canonical: "https://docs.perspectium.com/space/helium/2122651/Add%20and%20edit%20ServiceNow%20transform%20map%20scripts%20for%20Autotask"
format: markdown
---
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](https://docs.servicenow.com/bundle/madrid-platform-administration/page/script/server-scripting/concept/c_CreatingNewTransformMaps.html) 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](https://docs-perspectium.atlassian.net/wiki/spaces/helium/pages/2122645).

:warning: You will also need to [create a ServiceNow subscribed queue for Autotask](https://docs-perspectium.atlassian.net/wiki/spaces/helium/pages/2122647) and [edit ServiceNow outbound table map fields for Autotask](https://docs-perspectium.atlassian.net/wiki/spaces/helium/pages/2122649).

## **Procedure**

To add and edit the PSP Common Incident to Incident transform map scripts for Autotask, follow these steps:

---

> Macro (ui-steps)
> 
> > Macro (legacy-content)
> 
> > Macro (legacy-content)
> 
> | **When** | **Order** | **Script** |
> | --- | --- | --- |
> | OnAfter | 100 | (function runTransformScript(source, map, log, target /*undefined onStart*/ ) {<br>var qgr = new GlideRecord("u_psp_queues");  
> var queue = "";  
> qgr.addQuery("u_name", "[psp.in](http://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](https://docs-perspectium.atlassian.net/wiki/spaces/helium/pages/2122653)