Splunk IdentityIQ - Pending tasks

Which IIQ version are you inquiring about?

[Unsure]

Hello,

We are monitoring our Sailpoint instance with Splunk to alert when a task has been completed with errors in IdentityIQ.

How ever, I also need to create an alert for when a certain task has been in status “Pending” for X amount of days which then alarms in Teams. Since “pending” is not a status that can be extracted from the TaskResults API, and the attribute completionStatus does not include "pending, how would one go about doing this?

Best regards

HI @antdru94,

There isn’t a specific API to retrieve pending tasks. However, you can obtain pending tasks by filtering based on the start and completion dates. Please see the code below for reference.

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.Date;
import sailpoint.object.Filter;
import sailpoint.object.QueryOptions;
import sailpoint.object.TaskDefinition;
import sailpoint.object.TaskResult;

LocalDate startDate = LocalDate.now();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
Date startDate=formatter.parse(startDate.toString());

QueryOptions qo=new QueryOptions();
qo.addFilter(Filter.lt("created", startDate ));
qo.addFilter(Filter.isnull("completed"));
qo.addFilter(Filter.isnull("completionStatus"));

Iterator taskResult = context.search(TaskResult.class, qo);

if (null != taskResult) {
while(taskResult.hasNext()) {
      TaskResult tr = (TaskResult) taskResult.next();
      System.out.println("Task name " + tr.getName());
  
  }

}