Can we revert workflow to a previous version?

Tadz
Tera Guru
Tera Guru

Hi can we revert workflow to a previous version?

What would be best practice for having a back-up for workflow.

Thanks,

Tadz

1 ACCEPTED SOLUTION

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();


}


View solution in original post

17 REPLIES 17

great!


Holy most helpful post ever Batman....why isn't this documented somewhere!


Because it is a hack


Thanks for digging this up. Will create a small utility and post it here.


If you still just want to use this script (i.e. storing as as a fix script) instead of installing it as a UI action from the blog post in this thread, this is how I got the sys_ids.

 Go to "Workflow Versions"   and change the record filter to include unpublished (i.e. "All" and filter to contain the workflow name).  The copy the URL for the two records to a notepad to extract the sysIDs.

Kalaiarasan Pus
Giga Sage

Converted this to a platform solution instead of ad-hoc scripts. It is available here if someone is interested.


Unlearn Series - Reverting Workflow Version