Sunday, May 10, 2020

Sailpoint IdentityIQ Modify OOTB Identity Entitlements Detail Report


OOTB Identity Entitlements Detail Report Show all the Users in the Search , So if we want to modify this report and show only the Direct reportee of the logged in user , we need to modify the existing form which is used in this report "Identity Entitlements Report Search Fields" , Go to Debug page and search for the form "Identity Entitlements Report Search Fields" , Now in we need to replace 

<Field displayName="identities" helpKey="help_rept_identity_entitlement_identities" multi="true" name="identity" value="ref:identity"/>
with

    <Field displayName="identities" helpKey="help_rept_identity_entitlement_identities" multi="true" name="identity" value="ref:identity">
      <AllowedValuesDefinition>
        <Script>
          <Source>
            import sailpoint.object.*;
            import java.util.*;
            import org.apache.log4j.Logger;


            String idName = context.getUserName();
            List identityList3 = new ArrayList();
            QueryOptions qo = new QueryOptions();
            qo.addFilter(Filter.eq("manager.name", idName));
            List identityList = context.getObjects(Identity.class, qo);


            for(Identity id : identityList){
            List identityList2 = new ArrayList();
            identityList2.add(id.getId());
            identityList2.add(id.getName());

            identityList3.add(identityList2);
            }
            return identityList3;
          </Source>
        </Script>
      </AllowedValuesDefinition>
    </Field>

OOTB Identity Entitlements Detail Report Show all the Application in the Search , So if we want to modify this report and show only the Application which has application owner as the logged in user , we need to modify the existing form which is used in this report "Identity Entitlements Report Search Fields" , Go to Debug page and search for the form "Identity Entitlements Report Search Fields" , Now in we need to replace 

<Field displayName="applications" helpKey="help_rept_identity_entitlement_applications" multi="true" name="application" type="Application" value="ref:application"/>
with

<Field displayName="applications" helpKey="help_rept_identity_entitlement_applications" multi="true" name="application" type="Application" value="ref:application">
      <AllowedValuesDefinition>
        <Script>
          <Source>
            import sailpoint.api.SailPointContext;
            import sailpoint.object.Application;
            import sailpoint.object.Identity;
            import sailpoint.object.QueryOptions;
            import sailpoint.api.ObjectUtil;
            import sailpoint.object.Filter;

            String idName = context.getUserName();
            List appList3 = new ArrayList();

            if (idName != null)
            {
            QueryOptions ao = new QueryOptions();
            ao.addFilter(Filter.eq("owner.name",idName));
            List appList=context.getObjects(Application.class, ao);
            for(Application app : appList){
            List appList2 = new ArrayList();
            appList2.add(app.getId());
            appList2.add(app.getName());

            appList3.add(appList2);
            System.out.println("*****"+ app.getId() + "*********" + app.getName());
            }
            }
            return appList3;
          </Source>
        </Script>
      </AllowedValuesDefinition>
    </Field>