Retrieve identity attributes in Access Request Reviewer notification

Hi experts,

Im customizing Access Request Reviewer notification. In the notification I would like show some identity attributes of the requested identity, but I 've noticed that only it is possible retrieve requestedForIdentityName value.

Is there any way to retrieve identity object of user requested in this template?.

Thanks in advance,
Ismael

This is a great question. I have not configured this email template much, but I did some testing and see that I am unable to reference the receiving identity’s values.

Normally, for other templates, you can use ${identity.} to display that information (ex. ${identity.employeeType}) but that does not work in this template, and it appears “identity” may not be supported for this case.

Curious to see if anyone else has any thoughts on this.

According to the email template docs, most templates have a global variable called user that should provide access to identity attributes.

@colin_mckibben that’s interesting to me, because the user variable for the “Lifecycle State Change” template is the actual recipient of the email, not the subject of the change occurring. I feel like that may be the same for other templates.

Hi,

Finally I was able to retrieve identity based on context object in the following way

#set($spctx=$spTools.class.forName("sailpoint.api.SailPointFactory").getMethod("getFactory", null).invoke(null, null).getCurrentContext())

#set($identity=$spctx.getObjectByName($spTools.class.forName("sailpoint.object.Identity"), $requestedForIdentityName))

Get email value from context: ${identity.email}
3 Likes

What is this voodoo? @ismaelmoreno1 can you point us to where/how you found out about this solution? This is very cool and more information could help other community members access data they need in email templates.

2 Likes

Hi @colin_mckibben,

I appreciate that it is helpfull. I saw this solution from this entry:

Access to the SailPoint Context from within an Email Template - Compass

But there is a more information about that in these links:

Solved: Leaver Email Template - Compass (sailpoint.com)

Solved: email template Identity Request Id Object - Compass (sailpoint.com)

3 Likes

Hi @ismaelmoreno1

We tried implementing the same you have written in the body to get the identity details in the body part.

However, we are not able to get the identity details. Please let us know if any additional information we need to add in the body of template.

Any help is much appreciated.

Thanks
Narendra

Hi @ismaelmoreno1

You have to set the variables first then print those values in the e-mail template as shown below.

#set($spctx=$spTools.class.forName(“sailpoint.api.SailPointFactory”).getMethod(“getFactory”, null).invoke(null, null).getCurrentContext())

#set($identity=$spctx.getObjectByName($spTools.class.forName(“sailpoint.object.Identity”), $identityName))

#set($identityEmail = $identity.getAttribute(“email”))