Email Template Argument transformation using sptools

Which IIQ version are you inquiring about?

8.4

Share all details related to your problem, including any error messages you may have received.

I am trying to use email template to transform nativeIdentity to displayname of the account for Access Request.

I have used the following:
#set($spctx=$spTools.class.forName("sailpoint.api.SailPointFactory").getMethod("getFactory", null).invoke(null, null).getCurrentContext())

Is there anyway that I can use context to get the display name of the Link via its native Identity? Currently, I am using this
User Account : $approvalItem.nativeIdentity
which the nativeIdentity is the objectID of the account. To make it more meaningful to the person receiving the email, it needs to be the displayName of the account.

Hi @infamous,

The velocity text will only pull data from the ApprovalSet. If you want the link displayName it would need to be passed as a new argument from the workflow.

You could try adding the identity displayName at the start for a more user friendly experience, as follows:

#if ( $approvalItem.nativeIdentity )

<b>User Account:</b> ($identityDisplayName), $approvalItem.nativeIdentity <br/>

#end

Hi Nicholas, thanks for the reply. the identityDisplayName would not fit the use case as we have a column before that showcases this. Is there anyway that I can get the displayname of the target account using the nativeidentity value via #set($spctx=$spTools.class.forName(“sailpoint.api.SailPointFactory”).getMethod(“getFactory”, null).invoke(null, null).getCurrentContext())?

Thank you.

@infamous
Try Creating a rule which takes native Identity and Application Name as arguments and returns Display Name and call this rule within your email template

Something like below

 #if ( $approvalItem.nativeIdentity )  
  #set ($args = { 'nativeIdentity': $approvalItem.nativeIdentity },{ 'appName': $approvalItem.applicationName}) 
      #set ($rule = $spctx.getObjectByName($spTools.class.forName("sailpoint.object.Rule"), "GetAccountDisplayName")) 
      #if ( $spctx.runRule($rule, $args) ) 
            User Account: $spctx.runRule($rule, $args) <br> 
      #else
        User Account: $approvalItem.nativeIdentity <br> 
  #end
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.