How to create an RITM through script in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 08:16 AM
Hi All,
I need to create an RITM through run script in workflow in servicenow. Can someone please help with the same. Cart API is going to be deactivated in upcoming release and cartjs api apparently adds to sc_cart_item table. Can someone please help apart from the above
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2022 08:41 AM
@Arka Banerjee1 you can directly gliderecord on the requested item table and insert one like below.
var ritm = new GlideRecord('sc_req_item');
ritm.initialize();
ritm.short_description = "test";
//set all the required fields
ritm.insert();
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 12:41 AM
Hi Jaheer,
I need to create the ritm for one specific catalog item where I need to populate variables for that specific to that catalog item. Can you help me with the same. Initializing the ritm record would help me set values for sc_req_item table fields and not variables specific to a catalog item
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 01:01 AM
@Arka Banerjee1 Please try below code this should work for you
var ritm = new GlideRecord('sc_req_item');
ritm.initialize();
ritm.short_description = "test";
//set all the required fields
ritm.insert();
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-30-2022 01:19 AM
Hi Jaheer,
The item_option_new table seems to hold only variables specific to a catalog item. In the ritm that I need to create, there are some variables in variable sets which I need to set as well. Can you suggest me the way to set those variables contained in variable sets..