Hi Venugopala,
This is an excellent and common requirement for mature IdentityIQ implementations, especially around certification processes. Automating report generation and certification scheduling ensures compliance, reduces manual effort, and improves efficiency.
You can absolutely achieve this.
Answer to your 1st question:
Auto-Schedule and Auto-Generate OOTB Reports
IdentityIQ’s reports are essentially TaskDefinition objects in the backend. When you schedule a report in the UI, you’re creating a TaskSchedule object that references a TaskDefinition (the report template) and its parameters.
How to Automate:
The most common and effective way is to create a custom TaskDefinition of type “Run Rule” or “Execute Workflow” that then programmatically triggers the report generation tasks.
a. Create a Rule to Run Reports:
You’ll need a custom rule (type Rule - Task or a simple Rule if called from a workflow) that does the following:
- Load Report TaskDefinition: Get the
TaskDefinition object for each OOTB report you want to run.
- Create/Update TaskSchedule: Create a
TaskSchedule object (or modify an existing one) for each report.
- Set Parameters: Set the necessary parameters for the report (e.g.,
startDate, endDate, applicationName, certificationName, outputFormat (PDF/CSV)).
- Run the Task: Execute the
TaskSchedule.
Reference Code Example (Simplified Beanshell Rule):
This example shows how to run a report programmatically. You’d adapt this for each of your 4 reports.
import sailpoint.api.SailPointContext;
import sailpoint.object.TaskDefinition;
import sailpoint.object.TaskSchedule;
import sailpoint.object.Attributes;
import sailpoint.tools.GeneralException;
import java.util.Date;
import org.apache.log4j.Logger;
Logger log = Logger.getLogger("Rule.AutomateReportGeneration");
public String execute() throws GeneralException {
String status = "SUCCESS";
// --- Report 1: Example - "All Violations" Report ---
String report1Name = "All Violations"; // This is the TaskDefinition name for the OOTB report
String report1OutputName = "My_Certification_All_Violations_" + new Date().getTime(); // Unique name for the generated report instance
try {
TaskDefinition report1Def = context.getObject(TaskDefinition.class, report1Name);
if (report1Def == null) {
log.error("TaskDefinition for report '" + report1Name + "' not found.");
status = "FAILED - Report 1 not found";
} else {
TaskSchedule report1Schedule = new TaskSchedule();
report1Schedule.setName(report1OutputName);
report1Schedule.setDefinition(report1Def);
report1Schedule.setExclusive(true); // Don't allow multiple instances to run at once
// Set Report Parameters (VERY IMPORTANT - these match the report's parameters)
Attributes<String, Object> report1Args = new Attributes<>();
// Example parameters for an All Violations report (adjust as per actual report)
// You'll need to know the exact parameter names for your OOTB reports
report1Args.put("reportTitle", "Certification Compliance Violations");
report1Args.put("outputFormat", "PDF"); // Or "CSV"
report1Args.put("certifications", "My_Certification_Campaign_Name"); // If report filters by certification name
// Add any other specific filters or date ranges
// For dates, you might calculate based on current time:
// report1Args.put("startDate", DateUtils.addDays(new Date(), -30)); // Last 30 days
// report1Args.put("endDate", new Date());
report1Schedule.setArguments(report1Args);
// Save and execute the task
context.saveObject(report1Schedule);
context.commitTransaction(); // Commit the schedule to the DB
log.info("Scheduling report '" + report1Name + "' as '" + report1OutputName + "'.");
context.startRequest(report1Schedule); // This actually runs the task
log.info("Report '" + report1OutputName + "' has been triggered.");
}
} catch (Exception e) {
log.error("Error generating report '" + report1Name + "': " + e.getMessage(), e);
status = "FAILED - Report 1 Error";
}
// --- Repeat similar blocks for your other 3 OOTB reports ---
// Ensure unique names for each generated report instance.
return status;
}
Schedule the Rule Execution:
- Create a
TaskDefinition of type “Run Rule”:
- Go to Setup > Tasks > Task Definitions.
- Create a new
TaskDefinition.
Type: Select Run Rule.
Rule: Select the custom rule you created in step (a).
- Create a
TaskSchedule for this “Run Rule” Task:
- Go to Setup > Tasks > Task Schedules.
- Create a new schedule referencing your “Run Rule”
TaskDefinition.
- Set the desired frequency (e.g., daily, weekly, specific times).
Dependencies: If reports depend on fresh data, ensure they run after aggregations, identity refreshes, or policy scans.