Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Bulk incident ticket creation from Excel sheet.

Vengeful
Mega Sage

We have a requirement: Create a bulk of incident tickets using an Excel sheet and it should be auto-resolve.

Anyone can assist me for transform map script for this request?

1 ACCEPTED SOLUTION

Danish Bhairag2
Tera Sage

Hi @Vengeful ,

 

Please check this link. It has detailed steps

 

https://www.servicenowelite.com/blog/2013/11/24/incident-data-load

 

Thanks,

Danish

 

View solution in original post

16 REPLIES 16

Hi @Vengeful ,

 

Can u check the transform history whether any error is coming or it gets completed without errors.

If no error then can u try writing an on after transform script to update those 3 values n check whether it updates from transform script or not.

 

Thanks,

Danish

 

@Vengeful ,

 

Also if that does not work possible to share the excel file which u trying to load with 1 dummy data. I will try in my PDI n let u know.

 

Thanks,

Danish

 

@Danish Bhairag2 

Here's the excel file. Also, can you help to include the location on the script so I can no longer add the field to my excel file?

 

Script:

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

// Add your code here
//Find Assigned To
var grAssignedTo = new GlideRecord('sys_user');
grAssignedTo.addQuery('name','STARTSWITH',source.u_assigned_to);
grAssignedTo.query();
if (grAssignedTo.next()) {
target.assigned_to = grAssignedTo.sys_id;
}
//Find Caller
var grCaller = new GlideRecord('sys_user');
grCaller.addQuery('name','STARTSWITH', source.caller_id);
grCaller.query();
if (grCaller.next()) {
target.caller_id = grUser.sys_id;
}
//Find Resolved By
var grResolvedBy = new GlideRecord('sys_user');
grResolvedBy.addQuery('name','STARTSWITH',source.u_resolved_by);
grResolvedBy.query();
if (grResolvedBy.next()) {
target.resolved_by = grResolvedBy.sys_id;
}
})(source, map, log, target);

Hi @Vengeful ,

 

Let me check this in my PDI n get back to u.

 

Thanks,

Danish.

 

Hi @Vengeful ,

 

I see on incident table there are 2 different state fields. 1 is "Incident state" which is in excel other is "state" field which is in your screenshot. can u check whether incident state got updated & if yes then u can modify the mapping in transform map.

 

Thanks,

Danish