Leveraging Intelligent Recommendations for Operational Transformation. AMS Partners click HERE | EMEA/APJ Partners click HERE |
06/28/2024 01:13 AM
Hello all,
In the ARS, we have a Dynamic attribute named 'Additional Comments' which is a Plain Text Field.
And we need to enter the comments regarding the requesting access as shown in the screenshot below.
How to bring this value in the Email template?
I have used both the below syntaxes:
${accessItems.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('Additonal Comments')} .collect{it.attributeName.toString() + ': ' + it.attributeValue}.join('###')}.toString().replaceAll('\\[','').replaceAll('\\]','').replaceAll('\\,','')}
${dynamicAttrsList.find{ it.attributeName?.equalsIgnoreCase('Additonal Comments') }?.attributeValue}
And I got the below error:
We see the above error in the Email History Job log details.
It is saying that , there is no such property called 'IT'. 'it' is a keyword causing the issue here.
Any suggestions please!
Thanks & Regards,
SaviyntSavvy
06/28/2024 01:25 AM
@Saviynt_Savvy Where did you attach this email template and when this will be triggered?
07/02/2024 03:46 PM
Hello @SumathiSomala ,
I am using the email template in Workflow as shown in the below screenshot.
Thanks & Regards,
SaviyntSavvy
06/28/2024 02:45 AM
Hi @Saviynt_Savvy ,
Try below:
${accessItems.collect{it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Premdynamicattribute')}.collect{it.attributeValue}}}
OR
${task?.requestAccessKey?.collect{it.request_access_attrss.findAll{it.attributeName.toString().equalsIgnoreCase('Premdynamicattribute')}.collect{it.attributeValue}}.get(0)}
If this helps your question, please consider selecting Accept As Solution and hit Kudos
06/28/2024 08:24 PM
Are you storing attribute in accounts column ?
07/02/2024 03:47 PM - edited 07/02/2024 03:49 PM
Hello @rushikeshvartak ,
Yes, I am storing the attributes in the accounts column, 'CUSTOMPROPERTY11' and I am using it in the Workflow, which is attached to a Security System.
Thanks & Regards,
Saviynt Savvy
07/02/2024 04:01 PM
${accessItems.collect{it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('DynamicAttributeName')}.collect{it.attributeValue}}}
07/02/2024 07:35 PM
Hello @rushikeshvartak ,
I am using the below body in Email template:
<div>Hello ${requestor.username},</div><br><div>A request has been sent to ${assignee.username} for approval with Request ID - ${requestid}.<br><br><b>Request:</b>${accessItems.collect{it.request_access_attrss.find{it.attributeName.toString().equalsIgnoreCase('Additional Comments')}.collect{it.attributeValue}}}.<br><b>Justification:</b> ${task.comments}.</div><br><div>Thank you!<div/><div>Identity Access Management</div>
The dynamic attribute name is 'Additional Comments' and when I submit a request and run the 'Email History Job', the job fails and I see the below error in the Job Log Details:
I receive the email like below:
Any other syntax to check !
Thanks & Regards,
SaviyntSavvy
07/02/2024 07:44 PM
Remove ${task.comments} from email body
${task.comments} will not resolve as request is not approved yet
----------------------------------
FYI
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 {k,v -> println "$k = $v" + "" + "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: