- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 06:23 AM
Hi All,
We are working on creating a new server through a service catalog. So there is a variable called "No.of servers" with values till 5. If a requestor selects more than 1 need to create respective RITM's n same request. Ex: If a user selects 2 servers need to create 2 RITM, if 3 then 3 RITM's. Please help me how to achieve this.
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 07:22 AM
Hi @phani Deepthi ,
You can try below BR on RITM table.
replace with your variable name.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var serverValue=current.variables.no_of_servers;
for (var i = 1; i < serverValue; i++) {
var gr = new GlideRecord('sc_req_item');
gr.initialize();
gr.cat_item = current.cat_item;
gr.request = current.request;
gr.insert();
}
})(current, previous);
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2022 07:22 AM
Hi @phani Deepthi ,
You can try below BR on RITM table.
replace with your variable name.
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var serverValue=current.variables.no_of_servers;
for (var i = 1; i < serverValue; i++) {
var gr = new GlideRecord('sc_req_item');
gr.initialize();
gr.cat_item = current.cat_item;
gr.request = current.request;
gr.insert();
}
})(current, previous);
Please Mark My Response as Correct/Helpful based on Impact
Regards,
Gunjan Kiratkar
2X ServiceNow MVP
Community Rising Star 2022
Youtube : ServiceNow Guy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-23-2022 09:27 AM
You can uncheck the "Hide the 'Add to Cart button'" under Portal Settings of the Catalog item.