Skip to main content
All CollectionsSystem TasksWorking with Groovy ScriptsGroovy Script Library
Groovy Script - Read file attribute values from 'Edit Attributes' screen and update custom XML parts of .docx file
Groovy Script - Read file attribute values from 'Edit Attributes' screen and update custom XML parts of .docx file
Updated yesterday

Description: Sample groovy script to read file attribute values from 'Edit Attributes' screen and write those attribute data into custom XML parts of .docx file.

Context: Document

Remark: Accessible in 'Post' task mode only

Script:

def execute(){

HashMap<String,String> attributeMapping = new HashMap<>();

attributeMapping.put(IDocumentAttribute.REV,"Revision");

attributeMapping.put("Signatory Department","AuthorDepartment");

attributeMapping.put("My Classification","Classification");

documentService.writeAdoddleAttributesToFilePropertyAttributes(attributeMapping);

}



Did this answer your question?