- 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 11:12 AM
Hi Ken,
The new version of the workflow will not be associated with the old records. There is really no way to find which ones have the old ones, or which one refer to new ones, except that you will have to manually open them and see the contexts.
The way in which you will have to apply the new version is by cancelling the old Workflow and attaching the new workflow by Script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-05-2016 11:18 AM
Hi Pradeep,
We have a general idea on which records have very out to date workflow version. We are trying to update these records with our current workflow.
Do you have an example script of attaching a new workflow to a record?
Thanks,
Ken

- 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 11:33 AM
Problem is that is that if you restart, it's the old one that is restarted.
There are a couple of ways to attach the new one. You can set conditions on the workflow and when they are true, the workflow will attach it self. Next thing is that the new workflow is starting form the start, so if you were in the middle of the old one, the new one will start at the beginning. So it is always a pros Vs cons if you just want the old ones to finish and apply the new ones on new records.
How to start workflows with scripts you can look at the link Pradeep posted or the one at docs: https://developer.servicenow.com/app.do#!/api_doc?v=geneva&type=server&scoped=false&to=method_class_...
But If you can, it is easiest way to put it in the conditions on the workflow if the circumstances are right 😃
//Göran