Is there an automated way to create bulk requests?

Community Alums
Not applicable

We have "Server Decommission" request, this is actually a record producer to create Change tickets.

Is there an automated way to submit a large number of server decommission requests?

We have 100+ servers to decommission, is there an easier way for us to follow the process? Eg a spreadsheet that can be used as a checklist.

Let me know if this is possible and how?

7 REPLIES 7

sachin_namjoshi
Kilo Patron
Kilo Patron

Hi Rajini,



You can develop data source, transform map and transform scripts for bulk creation of change requests.


You can attach spreadsheet to data source and run your trasnform to create change requests in bulk as per your spreadsheet.



OR



you can create catalog item and create new workflow for server decommission. You can use run script activity in your workflow to create change requests in bulk.



Regards,


Sachin


chirag_bagdai
ServiceNow Employee
ServiceNow Employee

Hi Rajini,



I think, the easy way is to create import set table using Excel file.


1. Search in left navigation for   "Load Data" under "System Import Sets".


2. Create table and use "Source of the import" as "File" and attach excel file.


Screen Shot 2017-06-02 at 3.02.10 AM.png


3.   Excel data should be imported   in import set table (staging table).


4. You can prepare below script in which you need to provide import set table name, sys id of record producer and mapping of variables with import set table fields:



var gr = new GlideRecord('Import Set Table');


  gr.query();



  while(gr.next()) {


  var cart = new Cart();


// Sys ID of Record Producer


  var item = cart.addItem('6377b7a77f000001070ec31b396896fe');



  // Add variable name and assign value from import set table


  cart.setVariable(item, 'short_description', gr.u_short_description);


  cart.setVariable(item, 'description',gr.u_description);



  var rc = cart.placeOrder();


  }


Hello, 

It's been some time, but I'm trying to get more feedback on your solution. I ran my script and it doesn't appear to be working as desired. Is there a transform required to implement this solution. 

Steps completed thus far, built the master staging table and ran the script below to no avail. 

Can you provide further feedback> Thanks!

var gr = new GlideRecord('Import Set Table');


gr.query();

 

while(gr.next()) {


var cart = new Cart();


// Sys ID of Record Producer


var item = cart.addItem('23d7a28e2f5110107d7be83df699b684);


// Add variable name and assign value from import set table


cart.setVariable(item, 'short_description', gr.u_short_description);


cart.setVariable(item, 'employee_first_Name',gr.u_employee_first_Name);
cart.setVariable(item, 'employee_last_name',gr.u_employee_last_name);
cart.setVariable(item, 'title',gr.u_title);
cart.setVariable(item, 'manager',gr.u_manager);
cart.setVariable(item, 'department',gr.u_department);
cart.setVariable(item, 'location',gr.u_location);
cart.setVariable(item, 'cost center',gr.u_cost_center);
cart.setVariable(item, 'employee type',gr.u_employee_type);
cart.setVariable(item, 'exempt or non-exempt',gr.u_exempt_or_non-exempt);

var rc = cart.placeOrder();


}

Hi,

 

I tried your solution and it's partially working for me, was wondering if I might ask can I use a Service Request with tasks with this solution as well, as long as I have the sys_id of the request? Any changes needed for the script.