IIQ - Reports run in today's date

V8.4

Hi Everyone,

In Identity IQ Reports I want to schedule a report to run daily on “today’s date”.
How can I configure it in reports as from the UI the date is static or range, and I tried this code in the “Task Definition” and when i run the report it gave me error. so any ideas?

<entry key="start"> 

<value>

 <Script> 

<Source> 

import java.util.Date;

 return new Date(); 

</Source> 

</Script> 

</value> 

</entry>

@lojainahmed What is the type of the report? You actually need to define a date/period query parameter which can filter the report for you.

could you please share your logs also?

It’s “LiveReport”, the “Provisioning Transaction Object Report”

@lojainahmed For this you need to add a new field in the form: Provisioning Transaction Report Form, let’s say duration. Then in QueryParameter for createdDate you need to write a script to read the duration or you can write a queryScript and accordingly set the range of create date. Please review that and let us know if you need any further help with the changes.

This is something you’ll have to modify on the TaskDefinition object itself vs configuring in the UI

Would recommend using QueryParameters like the following example:

<DataSource objectType="sailpoint.object.ProvisioningTransaction" type="Filter">
  <QueryParameters>

    <!-- filters to transactions created at 12:00 AM today and beyond -->
    <Parameter property="created" operation="GE">
      <ValueScript>
        <Source>
          import java.util.Calendar;

          Calendar cal = Calendar.getInstance();
          cal.set(Calendar.HOUR_OF_DAY, 0);
          cal.set(Calendar.MINUTE, 0);
          cal.set(Calendar.SECOND, 0);
          cal.set(Calendar.MILLISECOND, 0);

          return cal.getTime();
        </Source>
      </ValueScript>
    </Parameter>

  </QueryParameters>
</DataSource>

where to write this code?
this is the TaskDefinition

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition created="1778144971754" id="0a21ca059d821804819e01b30bea1ae6" modified="1778155264087" name="Test - Applications Provisioning" resultAction="Rename" significantModified="1778155264087" subType="Administration Reports" type="LiveReport">
  <Attributes>
    <Map>
      <entry key="TaskDefinition.runLengthAverage" value="2"/>
      <entry key="TaskDefinition.runLengthTotal" value="5"/>
      <entry key="TaskDefinition.runs" value="2"/>
      <entry key="TaskSchedule.host"/>
      <entry key="applications">
        <value>
          <List>
            <String>Active Directory</String>
            <String>BitBucket</String>
            <String>C4C</String>
            <String>ELM RSA AM</String>
            <String>IdentityIQ</String>
            <String>JIRA</String>
            <String>Keycloak</String>
            <String>Microfocus Service Manager</String>
            <String>Nutanix</String>
            <String>SAP GRC</String>
            <String>SAP FIORI</String>
            <String>SAP Portal</String>
            <String>SAP S4 Systems</String>
            <String>SAP_Ariba</String>
            <String>SAP SuccessFactors</String>
            <String>Wiki</String>
          </List>
        </value>
      </entry>
      <entry key="creationDate">
        <value>
          <Map>
            <entry key="end"/>
            <entry key="start">
              <value>
                <Long>1778101200000</Long>
              </value>
            </entry>
          </Map>
        </value>
      </entry>
      <entry key="disableDetail" value="false"/>
      <entry key="disableHeader" value="false"/>
      <entry key="disableSummary" value="false"/>
      <entry key="dontEmailEmptyReport">
        <value>
          <Boolean></Boolean>
        </value>
      </entry>
      <entry key="emailFileFormat">
        <value>
          <List>
            <String>PDF</String>
            <String>CSV</String>
          </List>
        </value>
      </entry>
      <entry key="enableCsvHeader" value="false"/>
      <entry key="forced">
        <value>
          <Boolean></Boolean>
        </value>
      </entry>
      <entry key="operation">
        <value>
          <List>
            <String>Create</String>
            <String>Delete</String>
            <String>Disable</String>
            <String>Enable</String>
            <String>Modify</String>
            <String>Lock</String>
            <String>Unlock</String>
          </List>
        </value>
      </entry>
      <entry key="reportColumnOrder" value="name, applicationName, identityDisplayName, identityName, integration, nativeIdentity, accountDisplayName, status, type, operation, source, created, forced"/>
      <entry key="source">
        <value>
          <List>
            <String>LCM</String>
            <String>IdentityRefresh</String>
            <String>RapidSetup</String>
            <String>Rule</String>
            <String>Workflow</String>
            <String>Batch</String>
            <String>Certification</String>
            <String>PolicyViolation</String>
            <String>RoleChangePropagation</String>
            <String>WebService</String>
          </List>
        </value>
      </entry>
      <entry key="status">
        <value>
          <List>
            <String>Failed</String>
          </List>
        </value>
      </entry>
      <entry key="type">
        <value>
          <List>
            <String>Auto</String>
          </List>
        </value>
      </entry>
    </Map>
  </Attributes>
  <Description>Displays provisioning transactions.</Description>
  <Owner>
    <Reference class="sailpoint.object.Identity" id="0a21ca059d821804819df847c46275e8" name="ELM\lelsayed.c"/>
  </Owner>
  <Parent>
    <Reference class="sailpoint.object.TaskDefinition" id="0a21c37471a61e108171a64e81d30232" name="Provisioning Transaction Object Report"/>
  </Parent>
</TaskDefinition>

In the parent TaskDefinition referenced Provisioning Transaction Object Report. I would recommend cloning this versus editing the OOTB version to preserve the original.

I tried it but the date is still range

Can you explain more please

Hi @lojainahmed ,
Make a clone of the existing OOTB 'Provisioning Transaction Object Report". And add the following code to the report.

<OptionsScript>
                <Source>
                  import org.apache.log4j.Logger;

                  import sailpoint.object.QueryOptions;
                  import sailpoint.object.Filter;

                  import java.util.Date;
                  import java.time.LocalDate;
                  import java.time.ZoneId;
                  import java.time.ZonedDateTime;

                  if(options!=null){

                  ZonedDateTime startdate = ZonedDateTime.now();

                  ZonedDateTime today = startdate.minusDays(0).withHour(0).withMinute(0).withSecond(0).withNano(0); 

                  Date endDate = Date.from(today.toInstant());

                  Date startDate = Date.from(startdate.toInstant());

                  Filter filter1 = Filter.ge("created",endDate);

                  Filter filter2 = Filter.le("created",startDate);

                  options.addFilter(filter1);
                  options.addFilter(filter2);


                  }

                  return options;
                </Source>
              </OptionsScript>


This code filters the provisioning transaction object whose creation date is today.

And Schedule the cloned report daily to run the report daily with current date.

@lojainahmed What i meant is, you can add a duration field.. so the report can work for flexible durations like 1 day, 1 week, etc. Here are the changes which you need to make. (Before making the change, clone the OOTB artefacts and create a custom copy of it).

Form: Provisioning Transaction Report Form (Create a copy of it: Custom-Provisioning Transaction Report Form). Remove the creationDate field and add the below one:

 <Field columnSpan="2" displayName="Duration" helpKey="help_report_provisioning_date" name="duration" type="string" value="ref:creationDate">
      <AllowedValuesDefinition>
        <Value>
          <List>
            <String>1Day</String>
            <String>1Week</String>
            <String>1Month</String>
            <String>1Year</String>
          </List>
        </Value>
      </AllowedValuesDefinition>
    </Field>

TaskDefinition: Check the attached one for reference. Please ignore columns just focus on QueryParameter for duration and Signature for duration

Output:

for 1Month:

1 Year:

image

SampleProvTransactionReport-CreateDateDuration.xml (9.0 KB)

Hi @lojainahmed ,

can you put the below code in your report and try, please delete the static timestamp in created section for the report. You need to override the DataSource in the TaskDefinition to use a dynamic script. Add this inside your section:

<entry key="dataSource">
  <value>
    <DataSource objectType="sailpoint.object.ProvisioningTransaction" type="Filter">
      <QueryParameters>
        <Parameter property="created" operation="GE">
          <ValueScript>
            <Source>
              import java.util.Calendar;

              Calendar cal = Calendar.getInstance();
              cal.set(Calendar.HOUR_OF_DAY, 0);
              cal.set(Calendar.MINUTE, 0);
              cal.set(Calendar.SECOND, 0);
              cal.set(Calendar.MILLISECOND, 0);

              return cal.getTime();
            </Source>
          </ValueScript>
        </Parameter>
        <Parameter property="created" operation="LT">
          <ValueScript>
            <Source>
              import java.util.Calendar;

              Calendar cal = Calendar.getInstance();
              cal.set(Calendar.HOUR_OF_DAY, 23);
              cal.set(Calendar.MINUTE, 59);
              cal.set(Calendar.SECOND, 59);
              cal.set(Calendar.MILLISECOND, 999);

              return cal.getTime();
            </Source>
          </ValueScript>
        </Parameter>
      </QueryParameters>
    </DataSource>
  </value>
</entry>