How to raise a catalog request via inbout action
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 02:49 AM
Hi All,
Could any one guide how to raise a catalog request via inbound email action, the request should create a ritm and task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 10:58 AM
@Suvarna4 Can you go through the below API
https://developer.servicenow.com/dev.do#!/reference/api/utah/server/sn_impex/GlideExcelParserScopedA...
Kindly mark the answer Correct and Helpful if it helps to resolve your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 03:53 AM
Hi @Suvarna4,
I'd recommend leveraging the Cart API saving the hassle of manually building the REQ, RITM, and running the workflow.
Here's a framework of a script to use in the inbound action (You'll have to update a few variables and id's accordingly for your use case)
To help others, please mark as correct and/or helpful.
Thanks, Robbie
createRequest(); function createRequest() { var cart = new Cart(); // add in cart, substitute your catalog item sys_id var item = cart.addItem('00000000000000000000000000000000'); // set requested for, substitute your requested for //Set Variables in your Cart Item - item, variable_nmae, parameter cart.setVariable(item, 'requested_for', '00000000000000000000000000000000'); cart.setVariable(item, 'request_short_description', email.subject.toString()); cart.setVariable(item, 'request_description', email.body_html); cart.setVariable(item, 'request_type', 'others'); var cartmsg = "received from: " + email.origemail + "\n\n" + email.body_text; cart.setVariable(item,'comments',cartmsg); var rc = cart.placeOrder(); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:15 AM
you can use Cart API or CartJS Api for this
What did you start with and where are you stuck?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 06:31 AM
Hi @Suvarna4,
Did you see my response below?
So as to help others (or for me to help you direct one to one), please mark my response as correct and/or helpful.
Earlier response:
I'd recommend leveraging the Cart API saving the hassle of manually building the REQ, RITM, and running the workflow.
Here's a framework of a script to use in the inbound action (You'll have to update a few variables and id's accordingly for your use case)
To help others, please mark as correct and/or helpful.
Thanks, Robbie
createRequest(); function createRequest() { var cart = new Cart(); // add in cart, substitute your catalog item sys_id var item = cart.addItem('00000000000000000000000000000000'); // set requested for, substitute your requested for //Set Variables in your Cart Item - item, variable_nmae, parameter cart.setVariable(item, 'requested_for', '00000000000000000000000000000000'); cart.setVariable(item, 'request_short_description', email.subject.toString()); cart.setVariable(item, 'request_description', email.body_html); cart.setVariable(item, 'request_type', 'others'); var cartmsg = "received from: " + email.origemail + "\n\n" + email.body_text; cart.setVariable(item,'comments',cartmsg); var rc = cart.placeOrder(); }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-12-2024 03:44 AM
Hi @Suvarna4,
Did you see my response below?
So as to help others (or for me to help you direct one to one), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Earlier response:
I'd recommend leveraging the Cart API saving the hassle of manually building the REQ, RITM, and running the workflow.
Here's a framework of a script to use in the inbound action (You'll have to update a few variables and id's accordingly for your use case)
To help others, please mark as correct and/or helpful.
Thanks, Robbie
createRequest(); function createRequest() { var cart = new Cart(); // add in cart, substitute your catalog item sys_id var item = cart.addItem('00000000000000000000000000000000'); // set requested for, substitute your requested for //Set Variables in your Cart Item - item, variable_nmae, parameter cart.setVariable(item, 'requested_for', '00000000000000000000000000000000'); cart.setVariable(item, 'request_short_description', email.subject.toString()); cart.setVariable(item, 'request_description', email.body_html); cart.setVariable(item, 'request_type', 'others'); var cartmsg = "received from: " + email.origemail + "\n\n" + email.body_text; cart.setVariable(item,'comments',cartmsg); var rc = cart.placeOrder(); }