Copying sysiD from old instance to new

SathiskumarD
Tera Contributor

 

Hello,

 

I was trying to do transform map of work type records from old instance(A) to the new instance (B). We need sysIDs to be copied to the new instance. Below is the onBefore transform script. However, this isn't working. Anything wrong with my code? Any help or direction to resolve this would be greatly appreciated. 

 

 

 

 

 

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

	if (action == "insert") {target.setNewGuidValue(source.sys_id); }

})(source, map, log, target);

 

 

 

1 ACCEPTED SOLUTION

Hello @SathiskumarD , I'll suggest to create coalesce on the sys_id so that no conflict with the sys_id as you are trying to import something that is supposed to be unique across the platform.

Could you please delete the respective entries from the ServiceNow and try again by keeping the script enabled.

View solution in original post

11 REPLIES 11

So I created a new record in transform map where old SysID is matching with new sysID and coalesce is true. Then the onbefore transform script with change "u_sys_id". SysIDs are matching now. Thanks. 

Hello @SathiskumarD , Glad to hear that and thanks for the confirmation...

 

Regards,

Nishant