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>

Tuesday, May 5, 2020

Sailpoint Identity IQ List of Entitlement with Sunrise and Sunset Mapped for Particular User using DB Query


SQL to get the list of Entitlement with sunrise and sunset date  in Sailpoint IIQ which is mapped for the particular User , This query will give the information such as the Application Name , Entitlement Name , Entitlement Value , Sunrise and Sunset date , identity , Account ID


Select SPT_IDENTITY.NAME AS "USER ID" ,SPT_APPLICATION.NAME AS "APPLICATION NAME", 
SPT_IDENTITY_ENTITLEMENT.NATIVE_IDENTITY AS "ACCOUNT ID", 
SPT_IDENTITY_ENTITLEMENT.VALUE AS "ENTITLEMENT VALUE",
(
TO_DATE('1970-01-01 00', 'YYYY-MM-DD HH24') + (SPT_IDENTITY_ENTITLEMENT.END_DATE) / 1000 / 60 / 60 / 24
) AS "SUNSET DATE"
from SPT_IDENTITY_ENTITLEMENT , 
SPT_MANAGED_ATTRIBUTE , 
SPT_APPLICATION ,
SPT_IDENTITY 
where 
SPT_MANAGED_ATTRIBUTE.APPLICATION=SPT_IDENTITY_ENTITLEMENT.APPLICATION and
SPT_MANAGED_ATTRIBUTE.VALUE = SPT_IDENTITY_ENTITLEMENT.VALUE and 
SPT_IDENTITY_ENTITLEMENT.IDENTITY_ID = SPT_IDENTITY.ID and
SPT_APPLICATION.ID=SPT_MANAGED_ATTRIBUTE.APPLICATION and
SPT_IDENTITY.CORRELATED ='1' and
SPT_IDENTITY_ENTITLEMENT.END_DATE is not null