How to cancel all running workflows except the newest via a business rule?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 05:12 AM
Hi,
we have a process in place, that will trigger a workflow for each new user ... . This WF contains multiple steps and pauses for some weeks from time to time.
But if something happens "field value change on the table" via a business rule, the currently running workflow should be cancelled (it will restart again anyhow from new) ....
Any coding help here to be added to the business rule to cancel all open workflows ("name abc" for user "sys_id") ?
Thank you!!!
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 05:20 AM
Take a look here. might be what you are looking for and there is an example as well: https://developer.servicenow.com/app.do#!/api_doc?v=jakarta&id=r_WF-cancel_GR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 05:35 AM
Thanks Chuck, Thanks Göran,
I found a way to do a check more easily within the WF itself.
Anyhow - links are helpful!!