API / Rule to get the list of actively running tasks, Workflows and logged in users in the system

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

Hi All,

I am trying to get the list of actively running Tasks, Workflow, Users logged in, and pending access requests in the system. If anyone has sample code or information please share.

I really appreciate any help you can provide.

Hi @Learner ,

You can use the Access Request Status Report with status filter as Pending to get pending access request. You can leverage the Administrator Console (Gear Icon – Administrator Console - > Tasks ) . All the tasks under Active Tasks are pending. You can leverage the filter option to different type of pending tasks.

You can use the below code snippet if you want to get the pending task details via rule.

import java.sql.Connection;
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.logging.Log;

import sailpoint.api.SailPointContext;
import sailpoint.object.Filter;
import sailpoint.object.QueryOptions;
import sailpoint.object.TaskResult;
import sailpoint.tools.GeneralException;
  
    List taskList = new ArrayList();
    QueryOptions queryOptions = new QueryOptions();
    List typeListRequired = new ArrayList();
    typeListRequired.add("Generic");
    typeListRequired.add("AccountAggregation");
    typeListRequired.add("AccountGroupAggregation");
    typeListRequired.add("TargetAggregation");
    //typeListRequired.add("Workflow");

    Filter typeFilter = Filter.in("type", typeListRequired);
    Filter statusFilter = Filter.isnull("completionStatus");
    queryOptions.add(Filter.and(typeFilter,statusFilter));
    try {
       Iterator iterator = context.search(TaskResult.class, queryOptions);
       while(iterator.hasNext()){
        TaskResult taskResult = (TaskResult) iterator.next();
        taskList.add(taskResult.getName());
       }
    }catch (GeneralException e) {
      log.error("Error inside getTaskResults", e);
    }
  
return taskList;

You can add the types of task to be checked in the ArrayLit typeListRequired.

if you want to pull actively running task the filter on live = true
List liveTaskResults = new ArrayList();
QueryOptions queryOptions = new QueryOptions();
queryOptions.addFilter(Filter.eq(“live”,true));
Iterator trItr = context.search(TaskResult.class,queryOptions);
while(trItr.hasNext()){
TaskResult tr = trItr.next();
liveTaskResults.add(tr.getName());
}
return liveTaskResults;

Thank you for your inputs.

Thank you for your inputs @HemantSingh

Hi @Learner,
For finding out the logged in users
you can enable the Audit configuration from global settings
Global settings → Audit configuration → General Actions → Login (you can select this option)
once done from Adv analytics via Audit search type you can select the action as Login and find out the users who are logged into the identityiq system.(You can save the search result as a report and generate this the logged in user data as a report.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.