endpoints and entitlements not displaying in Access Request Approved email

K_India
New Contributor III
New Contributor III

Our requirement is to display endpoints name and corresponding entitlements who's Access Request is  Approved.

I am using following email template code

<table style="width: 100%; border-collapse: collapse; border: 1px solid #ddd;">
<tr>
<th style="background-color: #f2f2f2; border: 1px solid #ddd; padding: 8px; text-align: left;">Application</th>
<th style="background-color: #f2f2f2; border: 1px solid #ddd; padding: 8px; text-align: left;">Group Access Detail</th>
</tr>
<%
def endpointsWithoutParentheses = "${endpoints}".replaceAll("\\(|\\)", "")
def rows = entitlement_values.collect {
it.toString().indexOf("CN=") == -1 ? it : it.toString().substring(it.toString().indexOf("CN=") + 3, it.toString().indexOf(",", it.toString().indexOf("CN=")))
}.toListString().replaceAll('\\[|\\]','').split(', ')
rows.each { row ->
%>
<tr style="border: 1px solid #ddd;">
<td style="border: 1px solid #ddd; padding: 8px; text-align: left;">${endpointsWithoutParentheses}</td>
<td style="border: 1px solid #ddd; padding: 8px; text-align: left;">${row}</td>
</tr>
<% } %>
</table>

For one Endpoint access request it is working as expected, but when I request 2 endpoint and its entitlements it is not displaying endpoint in corresponding to its entitlement.

K_India_0-1684250683157.png

[email received snapshot]

I am getting entitlements names in  "Group Access Detail" column  correctly, but in "Application" column I am getting endpoint names in comma separated form for all entitlements.

I want to be endpoint and its corresponding entitlement in row
for eg:  ap1 -> ap1's entitlement 1, ap1 -> ap1's entitlement 2, ap2 -> ap2's entitlement 1, ap2 -> ap2's entitlement 2

BINDING VARIABLES : 

entitlements = [xxxx,xxxxx,xxxxx,xxxx]
request = com.saviynt.ecm.workflow.ARS_Requests : 2897
jbpm_activity_name = Grant_Access
exceptionCount = 0
allApproversComments = null
fullhtmlassignedrows =
requestkey = 706588
roles = null
rejectedByMap = [:]
fullrowhtmltablerows =
out = java.io.PrintWriter@56ca97a2
listofallrolesinrequest = []
assigneemanager = admin
endpoint = AP1
requesttype = New Account
dynamicAttrsList = []
entitlementshtmltablerowsv2 = AP2 App_M AP2 Prod SaaS [StartDate-(16 May 2023 13:57)UTC XyzCompany Federated SSO authentication AP2 Prod Cloud AP processing XyzCompany Federated SSO authentication AP2 Prod Cloud AP processing AP2 App_M AP2 Test SaaS [StartDate-(16 May 2023 13:57)UTC XyzCompany Federated SSO authentication AP2 Test Cloud AP processing XyzCompany Federated SSO authentication AP2 Test Cloud AP processing AP1 App_M AP1 Prod Administrators [StartDate-(16 May 2023 13:57)UTC Complete and Unrestricted Access to the System Complete and Unrestricted Access to the System AP1 App_M AP1 Prod AppAdmin [StartDate-(16 May 2023 13:57)UTC User Administrators for Master Data Maintenance User Administrators for Master Data Maintenance
approvallink = null/jbpmworkflowmanagement/showrequestdetails/Approval_DataOwner.706588
REQUESTORIGIN = ECMV6
allrolesinrequest =
requestlink = null/jbpmworkflowmanagement/showrequestdetails/Approval_DataOwner.706588?reqid=2897
email =
endpoints = (AP1, AP2)
entitlementshtmltablerows = AP2 App_M AP2 Prod SaaS XyzCompany Federated SSO authentication AP2 Prod Cloud AP processing XyzCompany Federated SSO authentication AP2 Prod Cloud AP processing AP2 App_M AP2 Test SaaS XyzCompany Federated SSO authentication AP2 Test Cloud AP processing XyzCompany Federated SSO authentication AP2 Test Cloud AP processing AP1 App_M AP1 Prod Administrators Complete and Unrestricted Access to the System Complete and Unrestricted Access to the System AP1 App_M AP1 Prod AppAdmin User Administrators for Master Data Maintenance User Administrators for Master Data Maintenance
allRejectorsComments = null
rolesshtmltablerows =
manager = TA
approvedByMap = [:]
rolesApprovedOrRejected = []
rolename =
ACCOUNTNAME = 81
request_access = com.saviynt.ecm.workflow.Request_Access : 3760
entitlement_values = [CN=App_M AP2 Prod SaaS,OU=Security Groups,OU=Users and Groups,DC=ssgrp,DC=XyzCompany,DC=com, CN=App_M AP2 Test SaaS,OU=Security Groups,OU=Users and Groups,DC=ssgrp,DC=XyzCompany,DC=com, CN=App_M AP1 Prod Administrators,OU=App_AP1,OU=Application Groups,OU=RGHL,OU=Security Groups,OU=Users and Groups,DC=ssgrp,DC=XyzCompany,DC=com, CN=App_M AP1 Prod AppAdmin,OU=App_AP1,OU=Application Groups,OU=RGHL,OU=Security Groups,OU=Users and Groups,DC=ssgrp,DC=XyzCompany,DC=com]
allApprovers = []
requestor = req_usernamexx
users = 81
allRejectors = []
task = com.saviynt.ecm.task.ArsTasks : 29042
requestid = 706588
rolemap = [:]
ENDPOINT = 181
baseUrlForEmail = https://xxxx.saviyntcloud.com/ECM
assignee = admin
activityname = Grant_Access
accounts = [[name:81, obj:null]]
user = 81
curExecutionId = Approval_DataOwner.706588
accessItems = [com.saviynt.ecm.workflow.Request_Access : 3758, com.saviynt.ecm.workflow.Request_Access : 3759, com.saviynt.ecm.workflow.Request_Access : 3760, com.saviynt.ecm.workflow.Request_Access : 3761, com.saviynt.ecm.workflow.Request_Access : 3762]

 

any solution suggestion is highly appreciated 

8 REPLIES 8

Sivagami
All-Star
All-Star

Try using one of the below binding variable for your requirement. 

Doc Reference - https://docs.saviyntcloud.com/bundle/EIC-Admin-v23x/page/Content/Chapter06-EIC-Configurations/Creati... 

${entitlementshtmltablerows}

Generates HTML Table rows as follows:
<tr><th>EndpointName</th> Entitlement_Value </th><th> Entitlement_Description </th> <th> Entitlement_Glossary </th> </tr>

This does not print <table> start tag and end tag. So, this can be defined in the email template as shown below:
update ecmemailtemplate set templatecontent =
templatecontent = '<div> <br/><table><tr><th>Endpoint</th><th> Entitlement </th> <th> Description </th> <th> Glossary </th> </tr> ${entitlementshtmltablerows} </table> </div>

${entitlementshtmltablerowsv2}

Prints all the requested entitlements, their business justification, start date, and end date, by defining the tags in email template.

${entitlementshtmltablerowsv3}

Generates HTML table to print Application Name, Entitlements, Entitlement Glossary, and Entitlement Description with the start date and end date, and Business Justification as specified by the requestor.

-Siva

K_India
New Contributor III
New Contributor III

I used ${entitlementshtmltablerows} earlier, but it has 2 problem

1st is <th> Description </th> <th> Glossary </th> I don't want this two columns

2nd is I am using string function to trim displayname from entitlement value "CN=App_Q AP2 Prod AQwa,OU=Security Groups,OU=Users and Groups,DC=ssgrp,DC=XyzCompany,DC=com "
So that too is not working with this ${entitlementshtmltablerows} attribute

any solution to only get Endpoint and  Entitlement columns only . 

use iterator 

Thank you for your response Rushi.

if possible can you help me with small code how to iterate it.
I have mentioned my email template code above for your reference  

K_India
New Contributor III
New Contributor III

By using  ${entitlementshtmltablerows} , I m getting 4 comums . I tried every possible way to remove Description and  Glossary column. but not removing it.

K_India_0-1684332135198.png

any solution to this problem?

 

I am also trying same will keep you posted 

Any update on this thread?

Hi Rushikesh

any update on this?

Thanks