Custom report about Identities

Hi community,
I’m trying to create a custom report in IIQ that retrieves data from Identity which have active AD accounts, Could you please guide !
I tried this data source type but it doesn’t work

<DataSource objectType="Identity" type="Filter">
              <QueryScript>
                <Source>
                     import sailpoint.object.*;
                     import sailpoint.object.Filter;
                    Filter f = Filter.and(Filter.notnull("application.id"),Filter.eq("application.id","ID"));
                     if (f!=null) {
                        queryOptions.addFilter(f);
                     }
                     return queryOptions;
                  </Source>
              </QueryScript>
            </DataSource>

but it doesn’t work
I’m using V 8.3

Thank you!

Hi @eneffati,

try with this datasource:

with parameters:

<DataSource objectType="sailpoint.object.Link" type="Filter">
    <QueryParameters>
      <Parameter argument="application" property="application.id"/>
      <Parameter argument="inactive" property="link.inactive" valueClass="boolean"/>
    </QueryParameters>
  </DataSource>

with defaultvalues:

<DataSource objectType="sailpoint.object.Link" type="Filter">
    <QueryParameters>
      <Parameter defaultValue="AD" property="application.id"/> //Change the name of app
      <Parameter defaultValue="false" property="link.inactive" valueClass="boolean"/>
    </QueryParameters>
  </DataSource>
sailpoint.tools.GeneralException: NullPointerException
	at sailpoint.persistence.HibernatePersistenceManager.countObjects(HibernatePersistenceManager.java:2758)
	at sailpoint.persistence.ClassPersistenceManager.countObjects(ClassPersistenceManager.java:358)
	at sailpoint.server.InternalContext.countObjects(InternalContext.java:918)
	at sailpoint.reporting.datasource.ProjectionDataSource.getSizeEstimate(ProjectionDataSource.java:61)
	at sailpoint.reporting.JasperCsvWriter.write(JasperCsvWriter.java:96)
	at sailpoint.reporting.LiveReportExecutor.execute(LiveReportExecutor.java:275)
	at sailpoint.api.TaskManager.runSync(TaskManager.java:981)
	at sailpoint.api.TaskManager.runSync(TaskManager.java:764)
	at sailpoint.scheduler.JobAdapter.execute(JobAdapter.java:128)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: java.lang.NullPointerException

I have NullPointer error I guess it comes from identites who don’t have any links

can you share the entire file of template?

          <LiveReport title="XXX- Comptes AD actifs">
              <DataSource objectType="Link" type="Filter">
                  <QueryParameters>
                      <Parameter defaultValue="ID" property="Application.id" />
                  </QueryParameters>
              </DataSource>
              <Columns>
                  <ReportColumnConfig field="name" header="ID" property="name" sortable="true" width="110" />
                  <ReportColumnConfig field="Mail" header="Mail" property="email" sortable="true" width="110" />
                  <ReportColumnConfig field="firstname" header="Prénom" property="firstname" sortable="true" width="110" />
                  <ReportColumnConfig field="lastname" header="Nom" property="lastname" sortable="true" width="110" />
                  <ReportColumnConfig field="Langue" header="Langue" property="name" sortable="true" width="60">
                      <RenderScript>
                          <Source> return "fr"; } </Source>
                      </RenderScript>
                  </ReportColumnConfig>
                  <ReportColumnConfig field="Zone géographique" header="Zone géographique" property="name" sortable="true" width="60">
                      <RenderScript>
                          <Source> return "Europe/Paris"; } </Source>
                      </RenderScript>
                  </ReportColumnConfig>
                  <ReportColumnConfig field="societe" header="Societe" property="libelleEstablishment" sortable="true" width="110" />
                  <ReportColumnConfig field="Oui" header="Oui" property="name" sortable="true" width="60">
                      <RenderScript>
                          <Source> return "Oui"; } </Source>
                      </RenderScript>
                  </ReportColumnConfig>
                  <ReportColumnConfig field="lastlogon" header="Dernière connexion" property="name" sortable="true" width="110">
                      <RenderScript>
                          <Source> import sailpoint.object.*; Identity identity = context.getObjectByName(Identity.class,value); Link account = identity.getLink(context.getObjectByName(Application.class,"Active directory")); if (account != null @and account.getAttribute("lastLogon") != null) {return account.getAttribute("lastLogon");} </Source>
                      </RenderScript>
                  </ReportColumnConfig>
              </Columns>
          </LiveReport>

is the application name “ID”?

and delete the parenthesis:
image

Hi @eneffati,

Try with this report

property=“application.id”

<LiveReport title="Test- Comptes AD actifs">
            <DataSource objectType="Link" type="Filter">
              <QueryParameters>
                <Parameter defaultValue="Active directory" property="application.name"/>
              </QueryParameters>
            </DataSource>
            <Columns>
              <ReportColumnConfig field="name" header="ID" property="identity.displayNme" sortable="true" width="110"/>
              <ReportColumnConfig field="mail" header="Mail" property="identity.email" sortable="true" width="110"/>
              <ReportColumnConfig field="firstname" header="Prénom" property="identity.firstname" sortable="true" width="110"/>
              <ReportColumnConfig field="lastname" header="Nom" property="identity.lastname" sortable="true" width="110"/>
              <ReportColumnConfig field="Langue" header="Langue" property="identity.displayName" sortable="true" width="60">
                <RenderScript>
                  <Source>
                                   return "fr";
                
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="Zone géographique" header="Zone géographique" property="identity.displayName" sortable="true" width="60">
                <RenderScript>
                  <Source>
                                   return "Europe/Paris";
                
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="societe" header="Societe" property="libelleEstablishment" sortable="true" width="110"/>
              <ReportColumnConfig field="Oui" header="Oui" property="identity.displayName" sortable="true" width="60">
                <RenderScript>
                  <Source>
                                   return "Oui";
                
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="lastlogon" header="Dernière connexion" property="identity.displayName" sortable="true" width="110">
                <RenderScript>
                  <Source>
                                    import sailpoint.object.*;
                                   	Identity identity = context.getObjectByName(Identity.class,value);
                										Link account = identity.getLink(context.getObjectByName(Application.class,"AD_Active-Directory"));
                                    if 	(account != null @and account.getAttribute("lastLogon") != null)
                										{return 	account.getAttribute("lastLogon");}   
                 
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
            </Columns>
          </LiveReport>

it always gives Null pointer exception
@enistri_devo No it’s Active Directory I already changed in the XML

Hi @eneffati,

You may try below snippet after removing below column as the source for it is not clear and adding it was throwing error.

<ReportColumnConfig field="societe" header="Societe" property="libelleEstablishment" sortable="true" width="110" />
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition executor="sailpoint.reporting.LiveReportExecutor" name="Custom Account by Attribute Report" progressMode="Percentage" resultAction="Rename" subType="Identity and User Reports" template="true" type="LiveReport">
  <Attributes>
    <Map>
      <entry key="TaskDefinition.runLengthAverage" value="3"/>
      <entry key="TaskDefinition.runLengthTotal" value="18"/>
      <entry key="TaskDefinition.runs" value="5"/>
      <entry key="report">
        <value>
          <LiveReport title="User Account Attributes Report">
            <DataSource objectType="sailpoint.object.Link" type="Filter">
              <QueryParameters>
                <Parameter defaultValue="Application Name" property="application.name"/>
              </QueryParameters>
            </DataSource>
            <ExtendedColumnScript>
              <Source>
                        
                        import java.util.*;
                        import sailpoint.reporting.*;
                        import sailpoint.object.*;

                        List newCols = new ArrayList();
                        Map formValues = form.getFieldValues();
                        if (formValues != null &amp;&amp; formValues.containsKey("application") &amp;&amp; formValues.get("application") != null){
                          newCols = ReportingLibrary.createApplicationAttributeColumns(context, formValues.get("application"));
                        }

                        return newCols;
                        
                    </Source>
            </ExtendedColumnScript>
            <ReportForm>
              <Reference class="sailpoint.object.Form" id="" name="Application Account by Attribute Report Form"/>
            </ReportForm>
            <Columns>
              <ReportColumnConfig field="name" header="ID" property="identity.displayName" sortable="true" width="110"/>
              <ReportColumnConfig field="mail" header="Mail" property="identity.email" sortable="true" width="110"/>
              <ReportColumnConfig field="firstname" header="Prénom" property="identity.firstname" sortable="true" width="110"/>
              <ReportColumnConfig field="lastname" header="Nom" property="identity.lastname" sortable="true" width="110"/>
              <ReportColumnConfig field="Langue" header="Langue" property="identity.displayName" sortable="true" width="60">
                <RenderScript>
                  <Source>
                                   return "fr";
                
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="Zone géographique" header="Zone géographique" property="identity.displayName" sortable="true" width="60">
                <RenderScript>
                  <Source>
                                   return "Europe/Paris";
                
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="Oui" header="Oui" property="identity.displayName" sortable="true" width="60">
                <RenderScript>
                  <Source>
                                   return "Oui";
                
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="lastlogon" header="Dernière connexion" property="identity.displayName" sortable="true" width="110">
                <RenderScript>
                  <Source>
                                    import sailpoint.object.*;
                                   	Identity identity = context.getObjectByName(Identity.class,value);
                										Link account = identity.getLink(context.getObjectByName(Application.class,"AD_Active-Directory"));
                                    if 	(account != null @and account.getAttribute("lastLogon") != null)
                										{return 	account.getAttribute("lastLogon");}   
                 
                
                                </Source>
                </RenderScript>
              </ReportColumnConfig>
            </Columns>
            <InitializationRule>
              <Reference class="sailpoint.object.Rule" id="" name="Account Report Form Customizer"/>
            </InitializationRule>
          </LiveReport>
        </value>
      </entry>
    </Map>
  </Attributes>
  <Description>Report for querying accounts on extended account attributes.</Description>
  <RequiredRights>
    <Reference class="sailpoint.object.SPRight" id="" name="FullAccessApplicationUserReport"/>
  </RequiredRights>
  <Signature>
    <Inputs>
      <Argument name="application" type="Application"/>
    </Inputs>
  </Signature>
</TaskDefinition>

Please try it and let us know if it achieved your use-case.

Thanks

@eneffati
Double check your line… <DataSource objectType="Link" type="Filter">

It should be like <DataSource objectType="sailpoint.object.Link" type="Filter"> and try.