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 over a week ago

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?