Multiple RITMS within one Request based on List Collector variable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 08:03 AM
Hello,
So working on a solution to create multiple RITM's within the same request based on a List Collector user reference variable. I would like to create a RITM for each user selected in the list. I have made some progress with the script listed below running as a "Run Script" in the workflow for this catalog item. This is generating the RITM's successfully, but only one RITM has the associated catalog item that is the next step in the workflow. So if I add 3 users to the list collector, I am getting 3 RITM's but only one of these has a catalog task. I think I am missing something minor just have been looking at it for too long. Any insight would be appreciated.
Thanks,
var options = ((current.variables.requested_for_list).toString()).split(','); //List collector variable to iterate through
{
for (i=1; i < options.length; i++) {
var ritm = new GlideRecord('sc_req_item');
ritm.initialize();
ritm.request = current.request; //This adds all items to one request
ritm.cat_item = current.cat_item;
ritm.requested_for = current.variables.requested_for_list;
ritm.state = 2; //set state to Work in Progress
ritm.short_description = 'Test Short Description';
ritm.description = 'Test Description';
ritm.assignment_group = 'f2e343f11b2a1050438a9827bc4bcb75';
ritm.due_date = current.due_date;
ritm.insert();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2022 08:15 AM
Hi @Cobee ,
1. I also worked on similar requirements and I preferred using Flow Designer Flow (added to catalog item). Used 'For' Flow Logic with only one 'Submit Catalog Item Request' action.
2. Created separate flow (added to catalog item) and in that flow added further actions depending on scenarios.
Regards,
Reshma
**Please mark my answer correct or helpful based on the impact**