cancel
Showing results for 
Search instead for 
Did you mean: 

Get Previous Version

tomoconnell
Champ in-the-making
Champ in-the-making
At the moment i'm trying to make a review workflow that on rejection will rollback (revert) the package to its previous version. This will be triggered by a rule on update.

I know how to revert to a specified version with
.revert(history, major , version);  aka node.revert("Workflow Rejection Rollback", false, 1.1);

But I don't how I can get the previous version number so I can replace the 1.1 above with a var containing the previous version.

Is this possible with javascript inside the wf definition?
1 REPLY 1

kaynezhang
World-Class Innovator
World-Class Innovator
Use ScriptNode 's versionHistory(ScriptVersion[] versionHistory) property,It lists all versions of the document in descending version created date order. Then you can get previous version of a document