- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-08-2018 11:55 AM
Hi All
I have callback date functionality recently developed where in if a ticket is in pending status, callback date is mandatory and when the callback date is elapsed, the system will automatically change the status from pending to Work in progress. This is achieved through a workflow
In case the callback date is changed by the resolver, a business rule will be triggered which will delete the old workflow context (which contains the old callback date) and a new workflow is created for this record.
The issue I am facing is that this record also has an approval workflow running and when I use workflow.deleteWorkflow(current) in the business rule, it deletes both the workflows, causing the approval flow to be triggered again.
Is there a way to delete a single workflow context of a record? I have tried using gliderecording the workflow context table and deleteWorkflow(gr) but it does not seem to work.
I would like to delete the old callback date workflow when the callback date in the ticket changes without touching the approval workflow. Is there a way to achieve this?
Any leads is appreciated.
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2018 12:47 AM
I got it to work thanks to Servicenow Guru.
I was able to cancel a specific the workflow context
https://www.servicenowguru.com/scripting/business-rules-scripting/canceling-executing-workflows-task-closure/

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-13-2018 06:43 AM
It seems that your approvals are generated via Workflow and therefore if you delete context - you delete both approvals and possibly even tasks. If you try building approvals outside of Workflow - this may be you solution. But keep in mid - it would be more complex.
Or as alternative - use reset Workflow instead of delete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2018 12:47 AM
I got it to work thanks to Servicenow Guru.
I was able to cancel a specific the workflow context
https://www.servicenowguru.com/scripting/business-rules-scripting/canceling-executing-workflows-task-closure/