Click HERE to see how Saviynt Intelligence is transforming the industry. |
06/07/2024 01:35 AM
I want to print the "displayname" of the entitlement (AADGroup) being created in an email template.
The email is being triggered from endpoint on the completion of "Create Entitlement" task. The application is using "AzureAD" connector and entitlement type is "AADGroup"
I have tried below objects to no avail so far:
${entitlement} // only prints "[]"
${task?.entitlement_valueKey?.entitlement_value} // prints "null"
Please suggest some variables that I can check, the documentation is of no help.
I tried below code to see all the exposed objects but that too is not working anymore in v24.5
${this.binding.variables.each {k,v -> println "$k = $v" + "<br>"}}
06/09/2024 01:23 AM - edited 06/09/2024 01:25 AM
@yogesh2 try below
${task?.entitlement_valueKey?.displayname}
and
${entitlement_values.collect{it.toString().indexOf("(") == -1 ? it : it.toString().substring(0, it.toString().indexOf("(") -1)}.toListString().replaceAll('\\[|\\]','')}
06/09/2024 09:35 PM - edited 06/09/2024 09:46 PM
first one sends "null" in the email:
when I use second one no email is sent and I see this error:
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 ERROR Exception occured while fetching requestid = java.lang.NullPointerException: Cannot invoke method get() on null object
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 DEBUG Start:prepareAndTriggerTaskCreateEmail
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 DEBUG End:prepareAndTriggerTaskCreateEmail
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 DEBUG Inside updateProvisioningTries..
06/09/2024 02:16 AM
Share output of binding code you received
06/09/2024 09:35 PM - edited 06/09/2024 09:46 PM
no email is sent when I use
${this.binding.variables.each {k,v -> println "$k = $v" + "<br>"}}
This is the error I see in logs:
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 ERROR Exception occured while fetching requestid = java.lang.NullPointerException: Cannot invoke method get() on null object
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 DEBUG Start:prepareAndTriggerTaskCreateEmail
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 DEBUG End:prepareAndTriggerTaskCreateEmail
2024-06-10T04:24:54.292+00:00 ecm-worker services.ArsTaskService quartzScheduler_Worker-4-wgxk8 DEBUG Inside updateProvisioningTries..
06/09/2024 10:21 PM
Share email template screenshot.
06/09/2024 11:21 PM
06/10/2024 08:06 PM
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:
06/10/2024 10:32 PM
I have tried with hardcoded email too, but still same error in logs and not receiving any email
It used to be so easy to troubleshoot emails with this code and now even this has stopped working in recent versions 🙁
06/10/2024 10:39 PM
Check logs