- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 06:26 AM
Hi, I want to cancel the workflow of a ticket using the flow designer.
currently in business rule using wf.cancel(current), I'm cancelling the workflow, but I am not getting any scripting option or OOB action to cancel the workflow for a ticket.
Can some help me with this please?
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 02:55 AM
Hi @Community Alums ,
Could you please try "cancelContext(GlideRecord context)" method.
// If a workflow has started for this item, cancel it, where current is a task record with a workflow context if ((current.stage == 'Request Cancelled') && current.context && !current.context.nil()) { var w = new Workflow(); var now_GR = new GlideRecord('wf_context'); if (now_GR.get(current.context)) w.cancelContext(now_GR); }
Please mark answer as helpful or correct if it works for you.
Regards,
Vallabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-03-2024 10:27 AM
Hi @Community Alums
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0750702
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 12:05 AM
Hi @Dr Atul G- LNG ,
I have checkout the KB0750702, but it's about just cancelling the flow when certain criteria are met, but I'm looking for somethings else.
I'm looking for a action or run script option to cancel the workflow (Please note I'm talking about legacy workflow and not the flow), using the flow designer.
Like currently we can cancel the workflow by using "wf.cancel(current)" in business rule when certain criteria is met. But Im looking whether if we can do that using flow designer only.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2024 05:30 AM
Hi @Community Alums
I think there is no OOTB way for this. other than the above link.
We may wait for expert to reply on this.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2024 02:55 AM
Hi @Community Alums ,
Could you please try "cancelContext(GlideRecord context)" method.
// If a workflow has started for this item, cancel it, where current is a task record with a workflow context if ((current.stage == 'Request Cancelled') && current.context && !current.context.nil()) { var w = new Workflow(); var now_GR = new GlideRecord('wf_context'); if (now_GR.get(current.context)) w.cancelContext(now_GR); }
Please mark answer as helpful or correct if it works for you.
Regards,
Vallabh