- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 12:16 PM
I'm using an Inbound Action to create a Request and a single RITM under it.
Everything got created and worked as expected. The REQ workflow triggered as soon as the record was created, once approved, the RITM workflow triggered and created catalog tasks as expected.
Then I threw a wrench into it and it broke. The requirement was that this particular item is a trivial request and should NOT generate any approvals on the REQ level and we simply need the catalog tasks created. So here was my approach: In the Inbound Action, I set the Request's approval state as "Approved". In the Request workflow, I set the condition to fire only when the Approval stat is no "Approved". So now, when the Inbound Action creates the REQ and RITM, the REQ Approval State is "Approved" as expected, and there's no workflow firing on the REQ, as expected. HOWEVER, the RITM doesn't fire a workflow either, so the needed catalog tasks are not getting created.
How can I make this work to meet my requirement? If I can make the RITM workflow fire somehow, I believe it would work.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 01:37 PM
Found a solution from this article: Request Generation Methods — ServiceNow Elite
Added the following into my Inbound Action:
var w = new Workflow();
wfSysId = w.getWorkflowFromName("workflowName");
var context = w.startFlow(wfSysId, current, current.operation());
if (context != null){
current.context = context.sys_id;
current.update();
}
That triggered the needed workflow and associated the context with the RITM.
I didn't try the cart approach since I'm not familiar with it, and the above was a simple fix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 12:41 PM
Yes, if you are not ordering the item, none of the workflows will trigger . The service catalog architecture is a little different from the others in SNOW. When you will order the item, then only you will be able to see the workflows getting attached. As a best practice, my suggestion would be to use the cart API to order the item dynamically and control the behavior of the approvals through the business rules.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 12:46 PM
You can start the RITM workflow through script but that will be a hassle. I would say when you mark req approved. Have a Business rule to order the Item from catalog and that will trigger the RITM workflow for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2017 01:37 PM
Found a solution from this article: Request Generation Methods — ServiceNow Elite
Added the following into my Inbound Action:
var w = new Workflow();
wfSysId = w.getWorkflowFromName("workflowName");
var context = w.startFlow(wfSysId, current, current.operation());
if (context != null){
current.context = context.sys_id;
current.update();
}
That triggered the needed workflow and associated the context with the RITM.
I didn't try the cart approach since I'm not familiar with it, and the above was a simple fix.