- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 08:22 PM - edited ‎10-18-2023 08:23 PM
Hi, our client wanted to generate RITM from Interaction without an associated cat_item. I re-used workspace UI Action to implement this however, the generated RITM throws an error when opened in the ESC portal. So I tried to generate a REQ then associate the RITM to it. I also created a simple WF to call to set the stage value to fulfillment. However, the WF won't trigger and I still have the same error in the ESC My Request portal.
Anyone can help me?
UI Action Table: Interaction
var req = new GlideRecord("sc_request");
req.initialize();
req.requested_for = current.opened_for;
req.opened_by = current.opened_for;
req.short_description = current.short_description;
req.description = current.description;
var reqID = req.insert();
var ritm = new GlideRecord('sc_req_item');
var wflw = new global.Workflow();
wflw.startFlow(wflw.getWorkflowFromName('RITM from Interaction'), current, 'update');
ritm.request = reqID;
ritm.short_description = current.short_description;
ritm.description = current.u_description;
ritm.assignment_group = "Service Desk";
ritm.insert();
action.openGlideRecord(ritm);
new InteractionRelationshipUtil().copyAttachments(current, ritm);
ESC My Request thrown error
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 10:14 PM
you should use Cart API to generate the REQ and RITM and not use GlideRecord
what are the variables present in the catalog item?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-18-2023 10:14 PM
you should use Cart API to generate the REQ and RITM and not use GlideRecord
what are the variables present in the catalog item?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-19-2023 07:13 AM
Thanks. Proceeded with creating the item and wf to use the cart api. Thanks.