Sample custom report for password requests made in IIQ

Hi All,

I am providing something useful in operations and in development as well, like getting the report in IIQ with code. The requirement is that when you want to get the report for who made the password request for the Active Directory application in the specific interval of time, we can use the below report. You can just import the form and task definition so that you can make use of it. We also have some OOTB reports, which we can use, but those reports have all the requests along with the password request, and also, if you want to update or add any column, you have to update the class file that was used by SailPoint. So, here I am using a filter query so that you can get it quickly. And also, it will be useful for the people who want to learn custom reports development. You can add how many and what columns you want in the report by adding render script for the columns.

The custom form:

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE Form PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<Form name="BPK Passwords Request Report Custom Form" type="Report">
  <Section columns="2" label="Report Form" name="customProperties">
    <Field columnSpan="1" displayName="Start Date" helpKey="startDate" name="creationStartDate" type="date" value="ref:creationStartDate"/>
    <Field columnSpan="1" displayName="End Date" helpKey="startDate" name="creationEndDate" type="date" value="ref:creationEndDate"/>
    <Field columnSpan="1" displayName="Request Type" helpKey="Type of request" name="requestType" type="radio" value="ref:requestType">
      <AllowedValues>
        <String>PasswordsRequest</String>
      </AllowedValues>
    </Field>
  </Section>
</Form>

The custom report:

t<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE TaskDefinition PUBLIC "sailpoint.dtd" "sailpoint.dtd">
<TaskDefinition executor="sailpoint.reporting.LiveReportExecutor" name="BPK Passwords Requests" progressMode="Percentage" resultAction="Rename" template="true" type="LiveReport">
  <Attributes>
    <Map>
      <entry key="report">
        <value>
          <LiveReport title="Application Access Request Report">
            <DataSource objectType="sailpoint.object.IdentityRequest" type="Filter">
              <QueryParameters>
                <Parameter argument="creationEndDate" operation="LE" property="created">
                  <ValueScript>
                    <Source><![CDATA[
                      log.error("Account Access Requests::end date value is ::"+value);
                      return value;
                    ]]></Source>
                  </ValueScript>
                </Parameter>
                <Parameter argument="creationStartDate" operation="GE" property="created">
                  <ValueScript>
                    <Source><![CDATA[
                      log.error("Account Access Requests::start date value is ::"+value);
                      return value;
                    ]]></Source>
                  </ValueScript>
                </Parameter>
                <Parameter argument="requestType" operation="EQ" property="type">
                  <ValueScript>
                    <Source><![CDATA[
                      log.error("Type of request ::"+value);
                      return value;
                    ]]></Source>
                  </ValueScript>
                </Parameter>
              </QueryParameters>
            </DataSource>
            <ReportForm>
              <Reference class="sailpoint.object.Form" name="BPK Passwords Request Report Custom Form"/>
            </ReportForm>
            <Columns>
              <ReportColumnConfig field="requestId" header="Access Request ID" property="name" sortable="true" width="110"/>
              <ReportColumnConfig field="requesterDisplayName" header="Requester" property="requesterDisplayName" sortable="true" width="110"/>
              <ReportColumnConfig field="requesteeDisplayName" header="Requested For" property="targetDisplayName" sortable="true" width="110"/>
              <ReportColumnConfig field="requesteeEmpNumber" header="Requested For Emp Number" property="targetId" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    
                    Identity id=context.getObjectById(Identity.class, value);
                    if (id!=null) return id.getName();
                    return "";

                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="requesteeUserID" header="User ID" property="targetId" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    
                    Identity id=context.getObjectById(Identity.class, value);
                    if (id!=null && id.getAttribute("userID") != null) return id.getAttribute("userID").toString();
                    return "";

                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="account" header="Account" property="id" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    import sailpoint.object.IdentityRequestItem;
                    import sailpoint.object.IdentityRequest;
                    
                    String returnValue = "";
                    IdentityRequest identityRequest =context.getObjectById(IdentityRequest.class, value);
                    if(identityRequest != null)
                    {
                    	if(identityRequest.getItems() != null)
                    	{
                    		IdentityRequestItem identityRequestItem = identityRequest.getItems().get(0);
                    		if(identityRequestItem != null)
                    		{
                    			returnValue = identityRequestItem.getNativeIdentity();
                    		}
                    	}
                    }
                    return returnValue;
                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="application" header="Application" property="id" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    import sailpoint.object.IdentityRequestItem;
                    import sailpoint.object.IdentityRequest;
                    
                    String returnValue = "";
                    IdentityRequest identityRequest =context.getObjectById(IdentityRequest.class, value);
                    if(identityRequest != null)
                    {
                    	if(identityRequest.getItems() != null)
                    	{
                    		IdentityRequestItem identityRequestItem = identityRequest.getItems().get(0);
                    		if(identityRequestItem != null)
                    		{
                    			returnValue = identityRequestItem.getApplication();
                    		}
                    	}
                    }
                    return returnValue;
                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="entitlement" header="Entitlement" property="id" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    import sailpoint.object.IdentityRequestItem;
                    import sailpoint.object.IdentityRequest;
                    
                    String returnValue = "";
                    IdentityRequest identityRequest =context.getObjectById(IdentityRequest.class, value);
                    if(identityRequest != null)
                    {
                    	if(identityRequest.getItems() != null)
                    	{
                    		IdentityRequestItem identityRequestItem = identityRequest.getItems().get(0);
                    		if(identityRequestItem != null)
                    		{
                    			returnValue = identityRequestItem.getName();
                    		}
                    	}
                    }
                    return returnValue;
                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="creationDate" header="Request Date" property="created" sortable="true" width="110"/>
              <ReportColumnConfig field="endDate" header="End Date" property="endDate" sortable="true" width="110"/>
              <ReportColumnConfig field="type" header="Request Type" property="type" sortable="true" width="110"/>
              <ReportColumnConfig field="operation" header="Operation" property="id" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    import sailpoint.object.IdentityRequestItem;
                    import sailpoint.object.IdentityRequest;
                    
                    String returnValue = "";
                    IdentityRequest identityRequest =context.getObjectById(IdentityRequest.class, value);
                    if(identityRequest != null)
                    {
                    	if(identityRequest.getItems() != null)
                    	{
                    		IdentityRequestItem identityRequestItem = identityRequest.getItems().get(0);
                    		if(identityRequestItem != null)
                    		{
                    			returnValue = identityRequestItem.getOperation();
                    		}
                    	}
                    }
                    return returnValue;
                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="approvalState" header="Approval State" property="id" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    import sailpoint.object.IdentityRequestItem;
                    import sailpoint.object.IdentityRequest;
                    
                    String returnValue = "";
                    IdentityRequest identityRequest =context.getObjectById(IdentityRequest.class, value);
                    if(identityRequest != null)
                    {
                    	if(identityRequest.getItems() != null)
                    	{
                    		IdentityRequestItem identityRequestItem = identityRequest.getItems().get(0);
                    		if(identityRequestItem != null && identityRequestItem.getApprovalState() != null)
                    		{
                    			returnValue = identityRequestItem.getApprovalState().toString();
                    		}
                    	}
                    }
                    return returnValue;
                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
              <ReportColumnConfig field="provisioningState" header="Provisioning State" property="id" sortable="true" width="110">
                <RenderScript>
                  <Source><![CDATA[
                    import sailpoint.object.Identity;
                    import sailpoint.object.IdentityRequestItem;
                    import sailpoint.object.IdentityRequest;
                    
                    String returnValue = "";
                    IdentityRequest identityRequest =context.getObjectById(IdentityRequest.class, value);
                    if(identityRequest != null)
                    {
                    	if(identityRequest.getItems() != null)
                    	{
                    		IdentityRequestItem identityRequestItem = identityRequest.getItems().get(0);
                    		if(identityRequestItem != null && identityRequestItem.getProvisioningState() != null)
                    		{
                    			returnValue = identityRequestItem.getProvisioningState().toString();
                    		}
                    	}
                    }
                    return returnValue;
                  ]]></Source>
                </RenderScript>
              </ReportColumnConfig>
            </Columns>
          </LiveReport>
        </value>
      </entry>
    </Map>
  </Attributes>
  <Description>Displays about password change requests</Description>
  <RequiredRights>
    <Reference class="sailpoint.object.SPRight" name="FullAccessAccountGroupMembershipReport"/>
  </RequiredRights>
  <Signature>
    <Inputs>
      <Argument name="creationStartDate" type="date">
        <Description>report_provisiong_date</Description>
      </Argument>
      <Argument name="creationEndDate" type="date">
        <Description>report_provisiong_date</Description>
      </Argument>
      <Argument name="requestType" type="String">
        <Description>Type of request</Description>
      </Argument>
    </Inputs>
  </Signature>
</TaskDefinition>

All you have to do is select the start and end dates. You can also leave the end date so that you will get all requests from the start date to the till date. And select the PasswordsRequests option as well.

For more details on reports please find it here.

Feel free to reach out to me if you have any questions. Thank you!

5 Likes