- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 05:40 AM
Hi,
I have a requirement. Kindly help.
Cancelling a change requires users to have all tasks closed before the change can cancel. This creates a ton of extra work on the requestor to track these down manually and have other users close them. Add a condition to the cancel button that will cancel all tasks, in addition to approvals and the change itself. Cancel change button should cancel everything.
Regards
Suman P.
Solved! Go to Solution.
- Labels:
-
Change Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 05:50 AM
Hello,
Just check if cancelling workflow will do all the things ?
var w = new Workflow();
var gr = new GlideRecord(‘wf_context’);
if (gr.get(current.context))
w.cancelContext(gr);
}
}
Regards
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 05:50 AM
Hello,
Just check if cancelling workflow will do all the things ?
var w = new Workflow();
var gr = new GlideRecord(‘wf_context’);
if (gr.get(current.context))
w.cancelContext(gr);
}
}
Regards
Regards,
Musab
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 06:00 AM
Hi Masaab,
We are doing the flow designer and not workflow, does it work?
Regards
Suman P.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 06:13 AM
Not sure about flow designer but Check this out
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0959612
Regards
Regards,
Musab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2022 06:03 AM
Hi,
You can try cancelling workflow as mentioned by
or else try this script in cancel ui action
var ct = new GlideRecord('change_task');
ct.addQuery('change_request', current.sys_id);
ct.query();
while(ct.next())
{
ct.state = '4'; //check cancelled value
ct.update();
}
current.state = '4'; //check cancelled value
current.update();
Regards,
Sumanth