Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Approval Email - Display all requested roles' information using rolemap

adriencosson
Valued Contributor
Valued Contributor

Hello folks, hope anyone can help with the below requirement.

Context : Email in Access Approval Workflow

Requirement : Display all requested roles to Role Owners to ease their approval decision

Use Case : We have configured an approval workflow with 2 steps :

  1. Manager Approval
  2. Access Approval (Role Owners)

If multiple roles are being requested with different role owners, Role owners will get the roles they need to approve inside the rolesshtmltablerows variables.

We identified another binding variable named rolemap which includes all requested roles in the following format : [307:S4HANA_Accountant Project Manager - BEST Madrid - Multi Div - PRODUCTION, 284:S4HANA_Trade Marketing Manager/Director - Iberia Hub - Multi Div - PRODUCTION]

The pattern is [<rolekey1>:<role_name1>,<rolekey2>:<role_name2>,...]

Does anyone know if from this list we can retrieve the actual role objects to display :

  • Role's Display Name
  • Role's endpoint

I have tried the below but it sends be "null" value :

 

 

${for(int i=0; i>rolemap.size();i++){rolemap[i] + ', '}}

 

Thanks for your help

Regards,
Adrien COSSON
7 REPLIES 7

rushikeshvartak
All-Star
All-Star
  • Please confirm where email template is attached ? 
  • Is this for role management ?
  •  

 


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

adriencosson
Valued Contributor
Valued Contributor

Hi @rushikeshvartak ,

  • The email is attached in "Access Approval" task of Workflow

adriencosson_0-1712306728848.png

  • Workflow is attached to Security System for Access Request
Regards,
Adrien COSSON

Please share

To get what variables are present to use in the email template, check using the below expression. By putting it in the email body, it will print all variable names with values, and then accordingly, you can use it:


${this.binding.variables.each {k,v -> println "$k = $v" + "" + "br" + ">"}}


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

adriencosson
Valued Contributor
Valued Contributor

Hi @rushikeshvartak

That's exactly what I used to retrieve the below variable and value : 

rolemap : [307:S4HANA_Accountant Project Manager - BEST Madrid - Multi Div - PRODUCTION, 284:S4HANA_Trade Marketing Manager/Director - Iberia Hub - Multi Div - PRODUCTION]

My question is more to understand if anyone knows how, from this map, how to get the associated role display names and applications for each role in the map.

I did try the below but it returned null

${for(int i=0; i>rolemap.size();i++){rolemap[i] + ', '}}

So i'm asking for some sample script that would actually work.

Regards,
Adrien COSSON

rolemap.each { roleId, roleName -> def roleNameParts = roleName.split('_') def application = roleNameParts[0] def displayName = roleNameParts[1..-1].join('_') println "Role ID: $roleId, Display Name: $displayName, Application: $application" }


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

adriencosson
Valued Contributor
Valued Contributor

Hi @rushikeshvartak,

Thanks for the sample code given.

My use case would be to catch the role's information for each role in the map.

Is there a method to get the role's data from the roleId or roleName (e.g risk, customproperties, attached endpoint, etc.) ?

Regards,
Adrien COSSON

adriencosson
Valued Contributor
Valued Contributor

Hi @rushikeshvartak,

After some testing we were able to achieve the requirement using the below : 

${rolemap.each{roleId, roleName -> println 'RoleId : ' + roleId + ' - ' + roleName + ' - DisplayName : '+ com.saviynt.ecm.identitywarehouse.domain.Roles.findById(roleId).displayname + ' - Description : '+ com.saviynt.ecm.identitywarehouse.domain.Roles.findById(roleId).description + ' - Endpoint : '+ com.saviynt.ecm.identitywarehouse.domain.Endpoints.findById(com.saviynt.ecm.identitywarehouse.domain.Roles.findById(roleId).endpointkey).displayName + ', '}}
Regards,
Adrien COSSON