Script to generate req, ritm, task via inbound action servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hello Team
Can someone please give me script create req, ritm , task for a particular catalog item via inbound action
Thanks,
Sriram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
What did you already try and where are you stuck?
What is the email that is being received by the instance?
Why not do it simple and use Flow Designer?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
Hi,
Below script will create REQ and RITM. Task will be created only based on flow or workflow attached to the catalog item
var cart = new sn_sc.CartJS();
var requestedFor = '<sys_id of user>';
var variableVal1 = 'value 1';
var variableVal2 = 'value 2';
var requestedItem = {
'sysparm_id': '<sys_id of catalog item>',
'sysparm_quantity': '1', // You can change this if you want to order more quantity
'variables': {
'requested_for': requestedFor,
'short_description': variableVal1,
'description': variableVal2
}
};
var checkoutInfo = cart.checkoutCart();
var cartDetails = cart.orderNow(requestedItem);
var request = cart.submitOrder(request); // This will return the Glide record of REQ record
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
5 hours ago
your can use Inbound flow low-code, no-code approach and use "Submit Catalog Item Request" flow action to generate REQ, RITM and once that item is submitted it's associated Flow/Workflow will create the catalog task
check this link for help
Easiest way to Trigger Catalog Item Request via Inbound Email
OR
You can also use inbound action and CartJS API to submit that catalog item
something like this
var cart = new sn_sc.CartJS();
var request1 = {
'sysparm_id': 'ec10f4fd47266110b81cd855d36d4308', // sys_id of catalog item
'sysparm_quantity': '1',
'variables': {
'requested_for': producer.requested_for, //'8efae6cbdb038b00d6563cae7c961
'short_description': producer.short_description,
'description': producer.description
}
};
var checkoutInfo = cart.checkoutCart();
var cartDetails = cart.orderNow(request);
var requestDetails = cart.submitOrder(request);
💡 If my response helped, please mark it as correct ✔️ and close the thread 🔒 — this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader