I’m working with SailPoint IdentityIQ 8.4 and closing aging work items through a rule. The work items close correctly, but the related access requests don’t update automatically. I want the access request to close as soon as its work item is closed, without any manual updates. Right now, the work item status updates immediately, but the access request only closes after I manually run the Identity Request Maintenance task, which I want to avoid. Please let me know if you have any suggestions.
Ps - I would like to avoid execution of the commented code at the end.
I’ve always run something like this to close it out:
Workflower wf = new Workflower(context); // Used to complete work items
WorkItem wi = context.getObjectByName(WorkItem.class, "00002315");
for (ApprovalItem item : wi.getApprovalSet().getItems()) {
item.reject();
item.setState(WorkItem.State.Rejected);
}
wi.addComment("Auto rejected by this rule");
wi.setState(WorkItem.State.Rejected);
wf.finish(wi)
context.commitTransaction();
@Spoorthy_M1198 Have you tried launching the PIRM task at the end of your rule? You can launch it as soon as you are done closing the workitems.
Note: Found a fix?Help the community by marking the comment as solution. Feel free to react(,, etc.)with an emoji to show your appreciation or message me directly if your problem requires a deeper dive.
@Spoorthy_M1198 I meant running the task via code, not manually or scheduled. In that way you don’t need any additional customization to close the requests.
You can always add some code to close out the IdentityRequest object:
// Assuming you have WorkItem delcared as wi
// Close this out in the IdentityRequest
IdentityRequest ir = context.getObjectByName(IdentityRequest.class, wi.getIdentityRequestId());
if (ir != null) {
ir.setCompletionStatus(IdentityRequest.CompletionStatus.Success);
ir.setEndDate(new Date());
ir.setExecutionStatus(IdentityRequest.ExecutionStatus.Completed);
context.commitTransaction();
}
I don’t think so that could be the right approach, perform task is already a background task, which is scheduled in every organisation, and it takes lot of time to complete, depending on the environment configuration.
I would suggest @Spoorthy you to try updating it via code, you already have a rule, just add few lines of the code, as suggested by otherand you should be able to achieve your requirement
@naveenkumar3 Perform Identity Request Maintenance task is a scheduled task and runs independently. However in the usecases where we are handling the access request and work items via code (scheduled rule runner task) we can trigger the same PIRM task via code. No need to schedule the task separately.
Instead of scheduling PIRM directly, this rule runner could be a scheduled which can process the work item and then launch the PIRM task at the end of the rule. By doing this, it’ll process the requests whose workitems are closed via rule + it’ll process remaining access requests waiting for closures. We can avoid updating access request via code with this process.
Even you can execute PIRM multiple times a day or can have multiple versions by creating new task from the template: Identity Request Maintenance.
I understand, but he already has a workitem rule, and can directly write the code to complete the identityrequest directly , instead of calling the perform task. It all depends on what spoorthy wants to go ahead.