This is a customization of OOTB - "LCM Identity Update Approval". Basically we need to group requested entitlements by application.
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE EmailTemplate PUBLIC "sailpoint.dtd""sailpoint.dtd">
- <EmailTemplate name="LCM Identity Update Approval">
- <Body><![CDATA[ <html><font size="3" face="arial">
-
- #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 ( $launcherIdentity = $spctx.getObjectByName($spTools.class.forName("sailpoint.object.Identity"), $launcher) )
-
- $item.Owner.DisplayName, <p>
-
- You have received an access change request for $identityDisplayName (${identity.getAttribute("JOB_TITLE")}), who reports to ${identity.Manager.DisplayName} in the ${identity.getAttribute("DEPT_NAME")} department. <p>
-
- The following systems access changes were requested on $spTools.formatDate($item.Created, "MMM d, yyyy") for ${identityDisplayName} by $launcherIdentity.DisplayName and require your approval.<p>
-
-
- #if ( $approvalSet.items )
-
- #set ($approvalSetScanned = [] )
-
- #foreach ($approvalItem in $approvalSet.items)
- #if ( !$approvalSetScanned.contains($approvalItem.id) )
-
- Application: $approvalItem.applicationName <br>
-
- #if ( $approvalItem.nativeIdentity )
- #set ($args = { 'userPrincipalName': ${identity.getAttribute("userPrincipalName")} })
- #set ($rule = $spctx.getObjectByName($spTools.class.forName("sailpoint.object.Rule"),
- "Get-AD-sAMAccountName"))
- #if ( $spctx.runRule($rule, $args) )
- Account ID: $spctx.runRule($rule, $args) <br>
- #else
- Account ID: $approvalItem.nativeIdentity <br>
- #end
-
- #end
-
- #foreach ($subApprovalItem in $approvalSet.items)
- #if ( !$approvalSetScanned.contains($subApprovalItem.id) && $approvalItem.applicationName == $subApprovalItem.applicationName)
-
- #set ( $result = $approvalSetScanned.add($subApprovalItem.id) )
-
- Operation: $subApprovalItem.operation <br>
-
- #if ( $subApprovalItem.displayValue )
- Role or Group Name: $subApprovalItem.displayValue <br>
- #elseif ( $subApprovalItem.csv )
- Role or Group Name: $subApprovalItem.csv <br>
- #end
-
- #set ($args = { 'entitlement': $subApprovalItem.csv,
- 'appName':$subApprovalItem.ApplicationName })
- #set ($rule = $spctx.getObjectByName($spTools.class.forName("sailpoint.object.Rule"),
- "Get-Entitlement-Desc"))
- #if ( $spctx.runRule($rule, $args) )
- Role or Group Desc: $spctx.runRule($rule, $args) <br>
- #end
-
- #if ( $subApprovalItem.requesterComments )
- Comments: $subApprovalItem.requesterComments <br>
- #end
- <p>
-
- #end
-
- #end
-
- #end
-
- #end
-
- #end
-
- </font></html>
- ]]> </Body>
- <Description>
- Email Template for notifying approvers when they need to approve a request made through LCM.
- Note that in addition to the declared arguments, all workflow variables,
- Step arguments, and Approval arguments defined in the Workflow are
- also available.
- </Description>
- <Signature>
- <Inputs>
- <Argument name="workflow" type="Workflow">
- <Description>The Workflow object being executed.</Description>
- </Argument>
- <Argument name="item" type="WorkItem">
- <Description>The WorkItem representing the review.</Description>
- </Argument>
- <Argument name="approvalSet" type="ApprovalSet">
- <Description>The ApprovalSet object contained in the work item.</Description>
- </Argument>
- <Argument name="launcher" type="string">
- <Description>The name of the Identity that launched the workflow.</Description>
- </Argument>
- <Argument name="identityName" type="string">
- <Description>The name of the Identity that is being changed.</Description>
- </Argument>
- <Argument name="identityDisplayName" type="string">
- <Description>The display name of the Identity that is being changed.</Description>
- </Argument>
- </Inputs>
- </Signature>
- <Subject>Changes requested for $identityDisplayName require approval</Subject>
- </EmailTemplate>