How to cancel/terminate the pending manual workitems

Hi All, we have an requirement that, when the user gets terminated at that time we need cancell all the pending access request to the user. Here, we are able to cancel the access reuest for automated apps but for disconnected apps it is getting generated manual workitem need to cancel that can we acheive this, your inputs will be helpful. Thanks in advance.

You can try something like this from the leaver workflow -
This code looks for all open approval and manual fulfilment workitems associated to the terminated user and close/cancel them out.

import java.util.List;
import sailpoint.object.;
import sailpoint.api.

Identity identity = context.getObjectByName(Identity.class, identityName);

if (null != identity) {

//log.debug(“Starting query for workitems”);
String idname = identity.getName();
String desc = "Manual Changes requested for User: " +identity.getDisplayName();
String desc2="Owner Approval - Account Changes for User: " +identity.getDisplayName();
//log.debug(“Description =” +desc);

Filter f1 = Filter.or(Filter.eq(“description”, desc), Filter.eq(“description”, desc2));
QueryOptions ops = new QueryOptions();
List items=context.getObjects(WorkItem.class,ops);

if(!items.isEmpty()) {
for (WorkItem item:items) {

 item.setCompletionComments("Cancelled due to user termination");
 Workflower workflower = new Workflower(context);  
  workflower.process(item, false);



} else {
log.error("Remove WorkItem Step – identity is null ");

Hope this is what you were looking for.

Hi @akash_gupta , thank you for the rule. let me try this, hopefully it will work.

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