Skip to main content

Groovy Script - Read File Attribute values from the 'Edit Attributes' screen and Update Custom XML parts of the .docx file

Updated over a month ago

Description: Sample Groovy script to read file attribute values from the 'Edit Attributes' screen and write those attribute data into custom XML parts of the .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?