Click HERE to see how Saviynt Intelligence is transforming the industry. |
09/25/2024 03:30 PM
Hello guys, I have a very simple question. I want to customize an Access Request Approval Notification email template including a substring from the Endpoint's name where the task was just performed. The endpoint's name can be easily retrieved from ${task.endpoint.endpointname}, but I have not been able to get the "DB_Namex" from the Endpoint's name. Here is the naming convention of the endpoint's name:
Database Type - Customer1 (DB_Name1) - Prod
Database Type - Customer2 (DB_Name2) - UAT
Database Type - Customer3 (DB_Name3) - Pilot
Again, I'm looking to extract only what's in between parenthesis, "DB_Namex". I've tried a few snippets of other forums that I've found helpful, but with very little luck:
- ${task.endpoint.endpointname.toString().substring(task.endpoint.endpointname.toString().indexOf("(")+1, task.endpoint.endpointname.toString.indexOf(")") -1)}
- ${task.endpoint.endpointname.collect{it.toString().indexOf("(") == -1 ? it : it.toString().substring(it.toString().indexOf("(")+1, it.toString().indexOf(")") -1)}}
I'm getting: There was an error while evaluating the email template, please login to ARS and complete the tasks assigned to you in the email notification.
Any help would be greatly appreciated!!!
Thanks!
Solved! Go to Solution.
09/25/2024 07:33 PM
${task?.endpoint?.endpointname?.toString()?.substring(task?.endpoint?.endpointname?.indexOf('(') + 1, task?.endpoint?.endpointname?.indexOf(')'))}
09/26/2024 07:32 AM
Thankyou @rushikeshvartak!!! That was it!! It is working now. Appreciate it!