Substring_index and Replace query not evaluating on the Revoke task emails from Campaigns

New Contributor
New Contributor


I am trying to evaluate subtring_index and Replace functions on the Entitlement_value at the task level variable on Revoke task email triggered from Certification but it is printing the query as in on the email and not evaluating it. Any idea on how to achieve this?

Query used: 


entitlement_value sample: CN=XYZ-Admin-Users,OU=AzureGroups,DC=companyname,DC=net


Thank you for all the help in advance! 



use java string function in email templates not sql function 

some example

Hi Rushi,

The current Output on the email is the group Distinguished Name:CN=groupname,OU=XXXXXX,OU=XXX,OU=XXXXX,OU=XXX,DC=org,DC=net
The expected Output on the email that we are looking at right now should be just the : groupname
Currently, we are using below variable in the email template for parsing the entitlement value: ${task?.entitlement_valueKey?.entitlement_value}
We have tried the below options using the substring index and replace commands in SQL and java string for the desired output but it is not helping.
${task?.entitlement_valueKey?.entitlement_value.collect{it.toString().indexOf(",") == -1?it:it.toString().substring(0,it.toString().indexOf(",") -1)}.toListString().replaceAll('CN=','')}
Can you confirm on the java string that we're parsing?
Best regards,
Jyothi Swarup

What’s error you are getting 

New Contributor
New Contributor

We are seeing only below lines in the logs

2022-12-07T22:57:11+05:30-ecm-worker-"log":"2022-12-07 17:27:10,739 [quartzScheduler_Worker-2] DEBUG campaigns.CampaignService - trying to send mail(s) for revoked tasks for Certification - Revo1 - sayeeda.rabiya (Sayeeda Rabiya)\n","stream":"stdout","time":"2022-12-07T17:27:10.739468194Z"
2022-12-07T22:57:11+05:30-ecm-worker-"log":"2022-12-07 17:27:10,739 [quartzScheduler_Worker-2] DEBUG campaigns.CampaignService - Email template found - Campaign Revoke Entitlement Based for Campaign-Revo1 and Certification - Revo1 - sayeeda.rabiya (Sayeeda Rabiya) \n","stream":"stdout","time":"2022-12-07T17:27:10.739561768Z"
2022-12-07T22:57:11+05:30-ecm-worker-"log":"2022-12-07 17:27:10,508 [quartzScheduler_Worker-2] DEBUG campaigns.CampaignEoAndRoService - Create Entitlement Revoke task for Ent Owner Certification-[Revo1 - sayeeda.rabiya (Sayeeda Rabiya)]\n","stream":"stdout","time":"2022-12-07T17:27:10.508527031Z"
Best regards,
Jyothi Swarup