How to retrieve pending workflow cases IDs from Sailpoint database with date range

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.

Want to retrieve all pending workflow cases from database with date range for clean up activity.

Please share how to set running policies for task, access request & workitems

We are able to see multiple tasks and provisioning requests are pending from long back

here’s the sample code which returns the workflow casese which are not completed and were created before 2 days … you can adjust the filter based on the requirement

 List pendingWorkfloCases = new ArrayList();
  QueryOptions queryOptions = new QueryOptions();

  queryOptions.addFilter(Filter.and(Filter.eq("complete",false),Filter.gt("created",Util.incrementDateByDays(new Date(), -2))));

  Iterator wcItr =  context.search(WorkflowCase.class,queryOptions);
  while(wcItr.hasNext()){
    WorkflowCase wc = wcItr.next();
    pendingWorkfloCases.add(wc.getId());		
  }

  return pendingWorkfloCases;

Hi @yogesh_thok,
You can refer this in the sailpoint community to get a rule created to automatically delete the workflow cases after a certain duration of time
#Rule the world: Delete work item(s) and workflow case(s) - Compass (sailpoint.com)

Even in the developer community zac adams have added - stale workitems clean up rule.

IDW Rule Runner Plugin: Rapid Development and Troubleshooting in the Browser - Community / Developer Days - SailPoint Developer Community Forum

1 Like

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