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

Kalaiarasan Pus
Giga Sage

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)


Thanks Kalaiarasan, will try that
I'll update you once done.



Thanks,


Tadz


Hi Kalaiarasan,



I can't published the old workflow version.
and I can't unpublished the new workflow version.



Should i delete the newer one?



Thanks,


Tadz


You cannot do this via UI. Use background script to change the published column value of the required version.