- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 02:00 PM
We started using Flow for our RITM. and we have already an UI Action that cancel the RITM. But unfortunantly it's working only for Catalog Item linked to Workflow, not to a Flow.
How can I change the script of the UI to cancel the Catalog Items related to Flow too ? as I can't find function that cancel the Flow similar to :
var workflow = new Workflow();
workflow.cancel(current);
Hereis the UI Action script :
Solved! Go to Solution.
- Labels:
-
flow designer
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 08:31 AM
Have you tried using the Flow context field on the ritm? If your UI action is running on the sc_req_item table you should just be able to do this:
var contextID = current.getValue('flow_context'); //you may have to query for this
sn_fd.FlowAPI.cancel(contextId, 'Cancellation reason.');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2020 02:39 PM
Similar to the Workflow API you can use the FlowAPI to cancel a flow using the contextID of the flow. There are some code examples in the link, but it's basically:
var contextID = 'flow context sys_id'; //you may have to query for this
sn_fd.FlowAPI.cancel(contextId, 'Cancellation reason.');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 08:18 AM
Hi
It's a great API, it will definitly help me with other issues too !
But now I can't figure out how to get the context ID related to my current RITM.
I found very little documetnation related this questionm like this imcomplete thread :
But I still not able to find which tables to query to get the context ID of the current RITM.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 08:31 AM
Have you tried using the Flow context field on the ritm? If your UI action is running on the sc_req_item table you should just be able to do this:
var contextID = current.getValue('flow_context'); //you may have to query for this
sn_fd.FlowAPI.cancel(contextId, 'Cancellation reason.');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2020 11:35 AM