Need to create Multiple RITM from one catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2023 05:27 AM
Hi,
I have a requirement, where I have to create multiple request items under a single request using one catalog form.
We have one list collector field If the User selects multiple value from list collector then the multiple ritm should be generated.
Tried the below code(for checkbox type variable) and getting the multiple ritm but workflow not getting attached and unable to see variable value on ritm(except the default RITM)
var ab = current.variables.check_box;
var ab1 = current.variables.check_box1;
var ab2 = current.variables.check_box2;
var mandatory = [ab,ab1,ab22];
var num = 0;
for (var i = 0; i < mandatory.length; i++) {
if (mandatory[i] == 'true') {
num ++;
}
}
for(var j = 0 ; j< num ; j ++){
var gr = new GlideRecord('sc_req_item');
gr.initialize();
gr.cat_item = current.cat_item;
gr.request= current.request;
gr.insert();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2023 05:34 AM
Hi @Nitesh Kumar5 ,
You can use the code mentioned in this post : https://www.servicenow.com/community/itsm-forum/creating-multiple-ritm-from-one-catalog/m-p/597887
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-02-2023 06:09 AM
@Community Alums I have already gone through the mentioned post and observed that same issue(Workflow not getting attached)