how to start or restart a workflow context without passing stages by default in servicenow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2016 11:40 PM
We have a requirement where I want to restart the workflow that is already finished. We have used the script mentioned below to restart the cancelled workflow but after restarting, the workflow is passing the stages by default.
var wkfw = new Workflow();
//var cancelflow = wkfw.getWorkflowVersionFromName('Workflow name');
var wfgr = new GlideRecord("wf_workflow");
wfgr.addQuery("name","'Workflow name");
wfgr.query();
if(wfgr.next()){
var wfid = wfgr.sys_id;
var x = new WorkflowApprovalUtils().reset(current, "res");
var context = new Workflow().startFlow(wfid, current, current.operation());
}
To restart the workflow, we have referred to the link below Restart a workflow context without affecting other workflows running on the record
Can anyone please guide on the same?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2016 02:44 AM
I love this community!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-07-2016 03:19 AM
Hi Khushboo,
Workflow is starting with new context, but bydefault it is passing all states/approvals. How to restart/reset all approval activities before restarting of the workflow context?
Thanks,
Anjali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2020 08:02 PM
Have you got the solution for this??, if yes could you please provide us as we the similar requirement where we need to restart only one workflow out of 2 workflows

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2020 09:40 PM
Hi
Refer below link might help you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2020 01:04 AM
Hi,
Have you tried the below one?