Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Update Document Revision number to two digit if it is in one digit & numeric only, after Document uploaded
Groovy Script - Update Document Revision number to two digit if it is in one digit & numeric only, after Document uploaded
Updated over a week ago

Description: Sample groovy script to update document revision number to two digit if it is in one digit and numeric only, after document uploaded

Context: Document

Remark: Accessible in 'Post' task mode only

Script:

def execute(){

DocumentVO document = documentService.getDocumentDetails();

String revision = document.getRevision();

if (revision.length() == 1 && revision.matches("[0-9]+")) {

documentContext.getDocVO().revision = "0"+revision;

documentService.updateDocument(documentContext);

}

}



Did this answer your question?