Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/26/2024 07:34 AM
We have workflow attached for User creation and modification and we need to include form attribute details in the email notification to approver and requestor.
Please share the sample code to fetch the User Form Attribute in the email notification
09/26/2024 08:32 AM
Please validate supported variables.
Purpose :
To get what variables are present to use in the email template.
Email Template steps :
keep Advanced HTML CSS flag is checked
Keep your email Address in TO
TO /CC/BCC & Subject - Don't use any dynamic variables
Add only below code in Email Body
${this.binding.variables.each {RVkey,RVvalue -> println "$RVkey ------- $RVvalue" + "" + "br" + ">"}}
Output : using the below expression. By putting it in the email body, it will print all variable names with values, and then accordingly, you can use it:
09/26/2024 08:46 AM - last edited on 09/26/2024 09:21 AM by Sunil
This is printing the following variables, do you have any sample to fetch User Form Attribute values
ServiceAccountOwnerMap ------- [:]
entitlements ------- [] accessapprovers ------- com.saviynt.ecm.workflow.Access_Approvers : 812
jbpm_activity_name ------- Third Party Registration Approvers allApproversComments ------- null fullrowhtmltablerows ------- listofallrolesinrequest ------- [] approvedEntitlementsOwners ------- [] entitlementshtmltablerowsv2 ------- entitlementshtmltablerowsv3 ------- ServiceAccountType ------- requestlink ------- null/jbpmworkflowmanagement/showrequestdetails/TP Registration Approvals.553050?reqid=433 allRejectorsComments ------- null rolesApprovedOrRejected ------- [] rolename ------- request_access ------- com.saviynt.ecm.workflow.Request_Access : 456 users ------- XXXX allRejectors ------- [] requestid ------- 553050 rolemap ------- [:] baseUrlForEmail ------- https://dev.saviyntcloud.com/ECM assignee ------- XXXX activityname ------- Third Party Registration Approvers ServiceAccountFlag ------- false request ------- com.saviynt.ecm.workflow.ARS_Requests : 433 exceptionCount ------- 0 fullhtmlassignedrows ------- requestkey ------- 553050 rejectedEntitlementsOwners ------- [] roles ------- null rejectedByMap ------- [:] out ------- java.io.PrintWriter@7e3d4986 assigneemanager ------- admin requesttype ------- dynamicAttrsList ------- [] approvallink ------- null/jbpmworkflowmanagement/showrequestdetails/TP Registration Approvals.553050 allrolesinrequest ------- email ------- endpoints ------- () entitlementshtmltablerows ------- rolesshtmltablerows ------- manager ------- 1006404 approvedByMap ------- [:] entitlement_values ------- [] allApprovers ------- [] requestor ------- XXXX accounts ------- [] user ------- XXXX curExecutionId ------- TP Registration Approvals.553050 accessItems ------- [com.saviynt.ecm.workflow.Request_Access : 456, com.saviynt.ecm.workflow.Request_Access : 456] [ServiceAccountOwnerMap:[:], entitlements:[], accessapprovers:com.saviynt.ecm.workflow.Access_Approvers : 812, jbpm_activity_name:Third Party Registration Approvers, allApproversComments:null, fullrowhtmltablerows:, listofallrolesinrequest:[], approvedEntitlementsOwners:[], entitlementshtmltablerowsv2:, entitlementshtmltablerowsv3:, ServiceAccountType:, requestlink:null/jbpmworkflowmanagement/showrequestdetails/TP Registration Approvals.553050?reqid=433, allRejectorsComments:null, rolesApprovedOrRejected:[], rolename:, request_access:com.saviynt.ecm.workflow.Request_Access : 456, users:XXXX, allRejectors:[], requestid:553050, rolemap:[:], baseUrlForEmail:https://dev.saviyntcloud.com/ECM , assignee:XXXX, activityname:Third Party Registration Approvers, ServiceAccountFlag:false, request:com.saviynt.ecm.workflow.ARS_Requests : 433, exceptionCount:0, fullhtmlassignedrows:, requestkey:553050, rejectedEntitlementsOwners:[], roles:null, rejectedByMap:[:], out:java.io.PrintWriter@7e3d4986, assigneemanager:admin, requesttype:, dynamicAttrsList:[], approvallink:null/jbpmworkflowmanagement/showrequestdetails/TP Registration Approvals.553050, allrolesinrequest:, email:, endpoints:(), entitlementshtmltablerows:, rolesshtmltablerows:, manager:1006404, approvedByMap:[:], entitlement_values:[], allApprovers:[], requestor:XXXX, accounts:[], user:XXXX, curExecutionId:TP Registration Approvals.553050, accessItems:[com.saviynt.ecm.workflow.Request_Access : 456, com.saviynt.ecm.workflow.Request_Access : 456]]
[This message has been edited by moderator to disable URL hyperlink]
09/26/2024 09:01 AM
Did you try below code from documentation?
${accessItems.findAll{it.request_access_attrss.size()}.collect{it.request_access_attrss.findAll{!it.attributeName.toString().equalsIgnoreCase('ENT_BY_RULE_ADD'))}.collect{it.attributeName.toString() + ':' +it.attributeValue}.join('###')}} | Obtains all the dynamic attributes in the request. |
${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Location')}.collect{it.attributeValue}}.get(0)} ${accessItems.collect{ it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Location')}.collect{it.attributeValue}}} where, Location is the dynamic attribute name. |