Hi All,
I hope everyone is doing well. We are seeking advice on how to implement the following automated process:
Auto-schedule and Auto-generate OOTB (Out-of-the-Box) reports before and after the certification.
Below are the Reports:
Pre-Reports:
• Users by Application Report
• Role Members Report (if an application has more than ten roles contact the IAM team)
• Identity Entitlements Detail Report (to identify the managers are under review)
• Role Profiles Composition Report - Extended
Post-reports:
• Certification Consolidated Live Report - Certification name(Certification Group)
• Revocation Live Report - Certification name(Certification Group)
• Role Profiles Composition Report
• Role Members Report
Note: Currently, as part of our certification event process, we manually generate 4 OOTB reports before and after each certification.
now, we have a requirement to automate these steps. Please advise on how we can achieve this and provide any reference code if available.
Specifically, we need guidance on:
How to automatically schedule and generate the required OOTB reports.
We tried it using rule But getting error while Auto-generating it.
Below is piece of code for reference :
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;
import sailpoint.api.TaskManager;
import org.apache.commons.lang3.time.DateUtils;
import java.util.UUID;
log.info(“Starting Report Generation”);
String status = “SUCCESS”;
// — Report 1: Example - “Users by Application Report” Report —
String report1Name = “Users by Application Report”;
String report1OutputName = “Users by Application Report_” + UUID.randomUUID().toString();
try {
TaskDefinition report1Def = context.getObject(TaskDefinition.class, report1Name);
if (report1Def == null) {
log.error(“TaskDefinition for report '” + report1Name + “’ not found.”);
status = “FAILED - Users by Application Report not found”;
} else {
TaskSchedule report1Schedule = new TaskSchedule();
report1Schedule.setName(report1OutputName);
report1Schedule.setDescription(“Users by Application Report”);
report1Schedule.setTaskDefinition(report1Def);
report1Schedule.setLauncher(“spadmin”);
Attributes report1Args = new Attributes();
report1Args.put("reportTitle", "Users by Application Report");
report1Args.put("outputFormat", "CSV");
report1Args.put("application", "Asia SIS Life Imaging System (Hong Kong)");
report1Args.put("startDate", DateUtils.addDays(new Date(), -30));
report1Args.put("endDate", new Date());
report1Schedule.setArguments(report1Args);
context.saveObject(report1Schedule);
Date now = new Date();
report1Schedule.setNextExecution(now);
TaskManager tm = new TaskManager(context);
tm.runNow(report1Schedule);
context.commitTransaction();
log.info("Report '" + report1Name + "' generation task started successfully with name: " + report1OutputName);
status = "SUCCESS - Report generation task started for: " + report1OutputName;
}
} catch (Exception e) {
log.error(“Error generating report '” + report1Name + "': " + e.getMessage(), e);
status = "FAILED - Report 1 Error: " + e.getMessage();
e.printStackTrace();
}
return status;
Note : Please advise on this.
Regards,
VU