- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 11:09 AM
Is it possible to apply the latest workflow version to old records/workflow?
I know there is a way to restart the workflow. Am I correct in saying that the restart workflow will restart the current workflow associated with the record? meaning it will restart the old workflow?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 11:20 AM
HI Ken,
I don't have script handy. Please refer below link on how you can restart workflow.
Workflow Script - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 12:07 PM
Thanks Ken for the update.
Please do mark my original answer as correct once the issue is resolved, so others can find it quickly when searching for the same question
Kindly let me know if you have any questions.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-21-2019 02:51 AM
Try using below script, it works for me:
I'm using background script:
var gr = new GlideRecord('add_table_name');
gr.addEncodedQuery("add_your_query_here");
gr.query();
while (gr.next()) // use while for multiple, if for single record
{
var wkfw = new Workflow();
wkfw.deleteWorkflow(gr); // this will delete the workflow from the record
gr.add_field_name = 'add_field_value'; // update the record to attach the new workflow, the update should be matching with the trigger condition of the updated workflow version. For eg. gr.state = 'In Progress;'
gr.update();
}
Please mark this answer as true, if it solves your problem.