- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2021 02:06 AM
Is there any way to revert the version of the workflow?
I want to return the workflow to its initial state.
I could not manipulate Publish in the list of wf_workflow_version table.
How can I revert?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2021 02:35 AM
Hi
There will be always backup of previous workflow in wf_workflow_version table.
Remove all the filters by clicking 'All' in the navigation. Search the version you need and change the published column to true. (only one record in the version should be true for a given workflow).
Use background script to change the published column value of the required version
For deactivating the current:-
var getInc = new GlideRecord('wf_workflow_version');
if(getInc.get('3b95753ad0d60200085a28e2b5794e1e')) //change
{
getInc.published=false;
getInc.update();
}
To publish old one:-
var getInc = new GlideRecord('wf_workflow_version');
if(getInc.get('3b95753ad0d60200085a28e2b5794e1e')) //change
{
getInc.published=true;
getInc.update();
}
Note:-Get the Sys_id from here:
Also, refer to this solution , if this doesn't help:
https://community.servicenow.com/community?id=community_question&sys_id=7c92c721dbd8dbc01dcaf3231f961982
Don't forget to mark my answer correct & Helpful, if applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2021 02:35 AM
Hi
There will be always backup of previous workflow in wf_workflow_version table.
Remove all the filters by clicking 'All' in the navigation. Search the version you need and change the published column to true. (only one record in the version should be true for a given workflow).
Use background script to change the published column value of the required version
For deactivating the current:-
var getInc = new GlideRecord('wf_workflow_version');
if(getInc.get('3b95753ad0d60200085a28e2b5794e1e')) //change
{
getInc.published=false;
getInc.update();
}
To publish old one:-
var getInc = new GlideRecord('wf_workflow_version');
if(getInc.get('3b95753ad0d60200085a28e2b5794e1e')) //change
{
getInc.published=true;
getInc.update();
}
Note:-Get the Sys_id from here:
Also, refer to this solution , if this doesn't help:
https://community.servicenow.com/community?id=community_question&sys_id=7c92c721dbd8dbc01dcaf3231f961982
Don't forget to mark my answer correct & Helpful, if applicable.
Thanks,
Sandeep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2021 02:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-16-2021 02:54 AM
Open Workflow folder. Locate your workflow and expand it (+) For each file: Right click and click "Version history", select the correct version and click restore.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-27-2025 12:43 AM
Hi @Fisher8 ,
Can u please share the screenshot where we can get this restore option?
Best Regards,
Pooja