Announcing the SAVIYNT KNOWLEDGE EXCHANGE unifying the Saviynt forums, documentation, training, and more in a single search tool across platforms. Click HERE to read the Announcement.

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

YashC
New Contributor
New Contributor

Hi,

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: 

substring_index(replace('${task?.entitlement_valueKey?.entitlement_value}','CN=',''),",",'1')

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

 

Thank you for all the help in advance! 

4 REPLIES 4

rushikeshvartak
All-Star
All-Star

use java string function in email templates not sql function 

some example 

https://forums.saviynt.com/t5/identity-governance/fetching-substring-in-email-templates/m-p/11234


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

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.replace(substring_index(${task?.entitlement_valueKey?.entitlement_value},",",1),'CN=','')}
 
${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 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

rjyothiswarup
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