07/10/2024 05:25 AM
Hello Saviynters,
I need to form a table in email body.
Using below string in Email Template , , I am getting set of values however I need to pick only 3 values and put in table eg Endpoint NAme , Entitlement Value and User
Line in Email Template -> ${this.binding.variables.each {k,v -> println "$k = $v" + "<" + "br" + ">"}} Gives below output
[entitlement_endpoint_list:[Active_Directory], manager:srahate, createdBy:admin, service_accounts_list:[], ownerOnTerminate:srahate, serviceaccount_endpoints_list:[], user:ppaulin, requestor:srahate, entitlement_value_list:[CN=Testval,OU=User Groups,OU=SystemUsers,DC=testdomain,DC=test,DC=local], out:java.io.PrintWriter@4c0e5a79]
How do I form a table , can someone guide please.
Best Regards
Shraddha Rahate
Solved! Go to Solution.
07/10/2024 06:42 AM
<table border="1">
<tr>
<th>Endpoint Name</th>
<th>Entitlement Value</th>
<th>User</th>
</tr>
<tr>
<td>${this.binding.variables.get("entitlement_endpoint_list")[0]}</td>
<td>${this.binding.variables.get("entitlement_value_list")[0]}</td>
<td>${this.binding.variables.get("user")}</td>
</tr>
</table>
07/11/2024 02:27 AM
Hello Rushikesh,
Thanks for information however meanwhile I tried this and worked so thought to share with you
${this.ownerOnTerminate}
What if ,we have multiple values in this object , how to iterate the loop.
Best Regards
Shraddha Rahate
07/11/2024 04:52 AM
Hello Rushikesh,
I managed to iterate loop however when I set one user as owner for two entitlements and then i inactivate the user I am expecting to read both entitlements in email for Transfer Ownership.
In real what is happening is , whichever last entitlement I am updating only for that owner is getting updated. Why so
That will be great if you guide.
Best Regards
Shraddha Rahate
07/11/2024 07:28 AM
Share the latest response
07/11/2024 08:16 AM
Hello Rushikesh,
Current Response is as bellow wherein entitlement list has two values in one [] . I have marked it in bold. My plan is to iterate loop based on number of entitlements and number of Applications. If you have better suggestion then kindly share.
entitlement_endpoint_list = [Active_Directory]
manager = somename
createdBy = admin
service_accounts_list = []
ownerOnTerminate = somename
serviceaccount_endpoints_list = []
user = duser
requestor = somename
entitlement_value_list = [ CN=eval,OU=User Groups,OU=SystemUsers,DC=domain,DC=domain,DC=local, CN=eval2,OU=Microsoft Exchange Security Groups,DC=domain,DC=domain,DC=local]
out = java.io.PrintWriter@115c3e64
Best Regards
Shraddha
07/11/2024 12:41 PM - edited 07/11/2024 12:43 PM
<table style="width:80%;border:1px solid black;border-collapse:collapse"><tr> <th style="background: rgb(0, 0, 255);vertical-align: top;">Access Details</th> </tr> <% int count = Integer.parseInt("${entitlement.split(", ", 0).size()}"); for(int i = 0; i < count; i++) { %> <tr style="border:1px solid black;border-collapse:collapse"> <td style="border:1px solid black;border-collapse:collapse">${entitlement.split(", ", 0)[i].replaceAll("\\[","").replaceAll("\\]","")}</td> </tr> <% } %> </table>
07/12/2024 06:55 AM
Hello Rushikesh,
I used this way , worked fine -
<tr><td>${this.entitlement_value_list[i]}</td></tr>
Best Regards
Shraddha
07/12/2024 07:15 AM
So final working solution was
<table style="width:80%;border:1px solid black;border-collapse:collapse"><tr> <th style="background: rgb(0, 0, 255);vertical-align: top;">Access Details</th> </tr> <% int count = Integer.parseInt("${entitlement.split(", ", 0).size()}"); for(int i = 0; i < count; i++) { %> <tr style="border:1px solid black;border-collapse:collapse"> <td style="border:1px solid black;border-collapse:collapse">${this.entitlement_value_list[i]}</td> </tr> <% } %> </table>
07/15/2024 09:24 AM
Hello Rushikesh,
Is there any option to fetch Entitlement Display Name and Description based on this entitlement Value?
Best Regards
Shraddha Rahate