Multiple RITM creation for a Catalog Item

Bhaskar24
Tera Expert

Hi Guys,

 

Could you please help me on the below:

I have a requirement to create multiple RITMs for a Catalog Item.

The Catalog Item contains Variable: Requested For with type: List Collector. If we choose 5 users in this variable 5 RITMs should be created for 5 users.

 

Thanks

6 REPLIES 6

Munender Singh
Mega Sage

Hi,

You can use this code in your workflow to trigger the RITM under same request depending upon the input in the list variable.

Code:

var list = current.variables.varibalename.toString(); //variable containing users list

var list_split = list.split(',');

 

for(var counter = 0 ; counter< list_split.length; counter++){

 

var ritm = new GlideRecord('sc_req_item');

   ritm.newRecord();

   ritm.request = current.request;//to place all created ritm under same requested

   ritm.requested_for = list_split[counter];  // populate requested for in new created ritm

   ritm.insert();

}

 

Regards,

Munender

Hi Munender,

Thanks for your reply.

I have tried the code in the workflow, 3 RITMs created based on the selection of 3 users but Requested For is same for all the RITMs, Workflow not attached and Variables not filled for 2 RITMs.

Could you please help me.

 

Thanks

 

Bhaskar24
Tera Expert

Any help on this topic please!

Balaji14
ServiceNow Employee
ServiceNow Employee

Hi Bhaskar,

You can make use of the other Service Catalog functionalities such as Order Guides.

The specific purpose of the Order Guides is to add multiple RITMs based on the conditions. Kindly refer the below blogs to create and add the RITM based on the conditions.

Order Guide

Create an Order Guide

Create an Order Guide to add Catalog items

After creating the order guide you can select the Catalog items that needs to be added for the request.

In the rule base you can add the filter conditions based on the request that is placed. You can also set the quantity for the Items in the rule base

Regards

Balaji