Getting Error During Custom Report Creation in 'TaskResults ' for failed tasks

IIQ version 8.3

Getting error for custom report any solution to it

Blockquote

Preformatted text

Please check below code as ref


 <Attributes>
    <Map>
      <entry key="emailFileFormat">
        <value>
          <List>
            <String>CSV</String>
          </List>
        </value>
      </entry>
      <entry key="report">
        <value>
          <LiveReport disablePreview="true" title="Audit Events Live Report">
            <DataSource objectType="TaskResult" type="Filter">
              <QueryParameters>
                <Parameter argument="startDate" operation="ge" property="created"/>
                <Parameter argument="endDate" operation="le" property="created"/>
              </QueryParameters>
            </DataSource>
            <Columns>
              <QueryScript> 
    <Source>

		  import sailpoint.object.AuditEvent;
		  import sailpoint.api.SailPointContext;
		  import sailpoint.object.LiveReport;
		  import sailpoint.object.TaskResult;
		  import sailpoint.task.Monitor;
		  import sailpoint.tools.GeneralException;
		  import sailpoint.tools.General;
		  import java.util.List;
	          import java.util.ArrayList;
		  import java.util.Map
		  import java.util.HashMap;
		  
		
		  List <TaskResult>failedTasks = TaskResult.find("Status == 'FAILED'");
		  List<Map<String, Object>> reportData = new ArrayList<>();
		  
		  for(TaskResult task : failedTasks){
			  
			  Map <String , Object > row = new HashMap<>();
			  row.put("Task Name", task.getName());
			  row.put("Status", task.getStatus());
			  row.put("Error Message", task.getErrorMessage());
			  row.put("StartTime", task.getStartTime());
			  row.put("EndTime", task.getEndTime());
			  row.put("Duration", General.getDuration(task.getStartTime(), 
                                      `Preformatted text`task.getEndTime());
			  reportData.add(row);
			  
			  for(Map<String, Object>row : reportData){
				
				for(String key : print(key + ":"+ row.get(key)+"|"));
				  
			  }
			  System.out.println();
			  
		  }
		   </Source>
              </QueryScript> 
           </Columns>
          </LiveReport>
        </value>
      </entry>
    </Map>
  </Attributes>
  <Description>Displays Task Failure Audit Report.</Description>
  <Signature>
    <Inputs>
      <Argument name="startDate" type="date">
        <Description>for start date</Description>
      </Argument>
      <Argument name="endDate" type="date">
        <Description>for end date</Description>
      </Argument>
    </Inputs>
  </Signature>
</TaskDefinition>
		  
				

Hi @Sanket98 - What is the error you are getting?

Hi @Sanket98 ,

The provided report XML is not in the standard format. The ReportColumnConfig field should be included within the column tag to retrieve the required column.

Please refer the report to get the task details. If you select the completionStatus as Error, you will get the failed tasks.

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition executor="sailpoint.reporting.LiveReportExecutor"  name="Task Result Report" progressMode="Percentage" resultAction="Rename" subType="Lifecycle Manager Reports" template="true" type="LiveReport">
  <Attributes>
    <Map>
      <entry key="report">
        <value>
          <LiveReport title="Audit Events Live Report">
            <DataSource objectType="TaskResult" type="Filter">
              <QueryParameters>
                <Parameter argument="completionStatus" property="completionStatus"/>
                <Parameter argument="reqStartDate" operation="GE" property="created"/>
                <Parameter argument="reqEndDate" operation="LE" property="completed"/>
              </QueryParameters>
            </DataSource>
            <ReportForm>
              <Reference class="sailpoint.object.Form" id="0ab1c5f3947817bf819478dcba5a6afe" name="Task Result Status Form"/>
            </ReportForm>
            <Columns>
              <ReportColumnConfig field="TaskID" header="TaskID" property="id" sortable="true" valueClass="java.lang.String" width="110"/>
              <ReportColumnConfig field="TaskName" header="TaskName" property="name" sortable="true" valueClass="java.lang.String" width="110"/>
              <ReportColumnConfig field="created" header="Started" property="created" sortable="true" width="110"/>
              <ReportColumnConfig field="completed" header="Completed" property="completed" sortable="true" width="110"/>
              <ReportColumnConfig field="failureReasons" header="Failure Reasons" property="messages" scriptArguments="messages" sortable="true" width="110"/>
            </Columns>
          </LiveReport>
        </value>
      </entry>
    </Map>
  </Attributes>
  <Description>Displays Task Failure Report.</Description>
  <Signature>
    <Inputs>
      <Argument name="reqStartDate" type="date">
        <Description>for start date</Description>
      </Argument>
      <Argument name="reqEndDate" type="date">
        <Description>for end date</Description>
      </Argument>
      <Argument multi="true" name="completionStatus" type="string">
        <Description></Description>
      </Argument>
    </Inputs>
  </Signature>
</TaskDefinition>

Task Result Form.xml (1.0 KB)