Retrieving identity name from the task

Which IIQ version are you inquiring about?

Version 8.2

Share all details related to your problem, including any error messages you may have received.

How can we retrieve the identity name for the triggered workflow using hql .

I have triggered a joiner event and i am creating a custom report using datasource Hql with columns identityName, Joiner Event name, status . I need to get the name of the identity , joiner event name for which the identity is triggered and completion status of the task (i.e. Success or Fail).

the Query i used is :

from name,completionStatus from Taskresult where name LIKE ‘D%’

I am getting the name of the task and the status . how can we get name of the identity for which it is triggered.

I am getting the above result for that i need to get name of the Identity.

IdentityIQ Object Model and Usage.pdf (1.2 MB)

In the attached document, you will find diagrams that include the relationships between individual objects in the database.

1 Like

ok ,Thanks@abartkowski . can you provide any sample hql query on relationship between objects like relationship between identity and link object.

Hi @AkashRaavi131 ,

If you are referring to the SQL query you can use the following.

select name,completion_status,launcher from identityiq.spt_task_result where name like 'D%';

launcher is the column which holds the information who triggered the task.

can you provide hql query for the above mentioned column names and i need to get the name of the identity also as a column

@AkashRaavi131
Are you looking for identity name of the user on which the joiner triggered?

Can you provide the sample xml of task result you are querying.

Hi @AkashRaavi131 ,

It should be something like below.

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition executor="sailpoint.reporting.LiveReportExecutor" name="Task Status Report" progressMode="Percentage" resultAction="Rename" template="true" type="LiveReport">
  <Attributes>
    <Map>
      <entry key="report">
        <value>
          <LiveReport title="Task Status Report">
            <DataSource type="Hql">
              <Query>from TaskResult where name LIKE 'D%'</Query>
            </DataSource>
            <Columns>
              <ReportColumnConfig field="name" header="Name" property="name" sortable="true" width="110"/>
              <ReportColumnConfig field="completionStatus" header="Completion Status" property="completionStatus" sortable="true" width="110"/>
              <ReportColumnConfig field="launcher" header="Launcher" property="launcher" sortable="true" width="110"/>
            </Columns>
          </LiveReport>
        </value>
      </entry>
      <entry key="reportTitle" value="Task Status Report"/>
    </Map>
  </Attributes>
  <RequiredRights>
    <Reference class="sailpoint.object.SPRight" name="FullAccessEntitlementRequestStatusReport"/>
  </RequiredRights>
</TaskDefinition>

TaskResult have the traget_name and traget_id which is identity name and identity id but target name is not mapped so you need to join TraskResult and Identity table on id and targetId and then get the identity name from the identity table. see the HQL below whihc should work for your requirement.

select i.name,r.name,r.completionStatus from TaskResult r, Identity i where r.targetId = i.id and r.name like 'JOINER FEATURE FOR%'

Exactly this is the xml of the task i have written , but here the name of the identity is not coming . the result csv file i have provided.
samplereport.csv (1.9 KB)
in that i need to get the name of the identity in sperate column along with name of the event and completionStatus.

yes, I am looking for the identity name of the user on which the joiner triggered.
The sample xml I am using :
sample.txt (1.1 KB)

HI @AkashRaavi131 ,

Sorry, for the confusion. The query which I shared earlier will give the launcher of the workflow/task not the identity for it triggered.

In the spt_task_result table, we have couple of columns target_name and target_id which you can query to get the target users. But for Joiner events these values will will be null. In this case you can extract the identity name from task name using render script like below.

<ReportColumnConfig field="joinerName" header="JoinerName" property="name" sortable="true" width="110">
  <RenderScript>
     <Source>
       String joiner = value.substring(27);
       return joiner;
    </Source>
  </RenderScript>
</ReportColumnConfig>

Ideally speaking, it should by creating a report on Audit Events.

Hi @Jarin_James
Can you please provide the complete xml code.

I have got the above mentioned error " could not extract ResultSet"
and I also provided the xml code that i have written.
Reportxmlfile.txt (1.6 KB)


Can you try with this?
Reportxmlfile.txt (1.4 KB)

I am getting the below error:

sailpoint.tools.GeneralException: sailpoint.tools.GeneralException: The application script threw an exception: java.lang.StringIndexOutOfBoundsException: begin 27, end 24, length 24 BSF info: script at line: 0 column: columnNo
at sailpoint.api.DynamicValuator.evaluate(DynamicValuator.java:404)
at sailpoint.reporting.datasource.DataSourceColumnHelper.runColumnRenderer(DataSourceColumnHelper.java:57)
at sailpoint.reporting.datasource.BaseProjectionDataSource.getFieldValue(BaseProjectionDataSource.java:250)
at sailpoint.reporting.JasperCsvWriter.write(JasperCsvWriter.java:118)
at sailpoint.reporting.LiveReportExecutor.execute(LiveReportExecutor.java:275)
at sailpoint.api.TaskManager.runSync(TaskManager.java:909)
at sailpoint.api.TaskManager.runSync(TaskManager.java:724)
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)

The code below does the substring from 27th position to end of the string what happens if value is null or void or its less than 27 characters and these are cases where the below code will through exception

String joiner = value.substring(27);

you can change the above line to

  if(value != void &amp;&amp; value !=null &amp;&amp; value.length()>=27){
      return  value.substring(27);
  }else {
    return value;
}

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.