eneffati
(Emna Neffati)
September 10, 2024, 8:32am
1
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>
eneffati
(Emna Neffati)
September 10, 2024, 8:53am
3
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?
eneffati
(Emna Neffati)
September 10, 2024, 9:51am
7
<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>
enistri_devo
(Emanuele Nistri)
September 10, 2024, 10:45am
8
is the application name “ID”?
and delete the parenthesis:
Arun-Kumar
(Arun Kumar)
September 10, 2024, 11:52am
9
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>
eneffati
(Emna Neffati)
September 10, 2024, 12:16pm
10
it always gives Null pointer exception
@enistri_devo No it’s Active Directory I already changed in the XML
ashutosh08
(Ashutosh Singh)
September 13, 2024, 5:14pm
11
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 && formValues.containsKey("application") && 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.