Reverting the Workflow Version

miyu
Tera Guru

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?

1 ACCEPTED SOLUTION

Community Alums
Not applicable

Hi @miyu ,

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:

find_real_file.png

 

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

View solution in original post

4 REPLIES 4

Community Alums
Not applicable

Hi @miyu ,

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:

find_real_file.png

 

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

Dhanunjay2
Tera Guru

Hi miyu,

You can find the Updated versions 

find_real_file.png

find_real_file.png

You can copy the Old version here

find_real_file.png

Thanks

Fisher8
Kilo Contributor

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.

liteblue.usps.gov

Hi @Fisher8 ,

 

Can u please share the screenshot where we can get this restore option?

 

Best Regards,

Pooja