We try to use Workflow Metadata inside Assign Task notification eMail.
Sample https://docs.adobe.com/content/help/en/experience-manager-64/forms/publish-process-aem-forms/use-met... is working fine.
When using var wfmetadata = workItem.getWorkflow().getMetaDataMap();
witch is working in participantChoser getParticipant() we get error
/apps/fd/dashboard/scripts/metadataScripts/kpbTaskMetaData_v1.ecma: ReferenceError: "workItem" is not defined. (NO_SCRIPT_NAME#28)
Please advice how to get Workflow Metadata based on ECMA Script in Assign Task
Thanks for any help
this is working in the ecma script
var workflowData = workItem.getWorkflowData();
var payloadPath = workItem.getWorkflowData().getPayload().toString();
log.info("The path is "+payloadPath);
Once you get the payloadPath, you can acces the submitteddata and from there do the rest
I recommend creating osgi service to do this
Let us know if you have problems