Hello @hs25102025 as @pattabhi mentioned, that should be enough for pruning the events. However, since you’re still seeing them, you can try the code below once. Before that, let me explain, all the identity events can be found in the table spt_audit_event(By following this doc Find identity event.) In this table, you can see details such as the action, target identity, and whether the event was processed for the user. You can retrieve these attributes and values and remove the corresponding entries from the table if needed.
Example Code:
import sailpoint.object.AuditEvent;
import sailpoint.object.QueryOptions;
import sailpoint.object.Filter;
QueryOptions qo = new QueryOptions();
qo.add(Filter.eq("action", "identityLifecycleEvent"));
qo.add(Filter.like("target", "Your-Identity"));
qo.add(Filter.like("string3", "Rapid Setup Leaver processed a lifecycle event"));
Iterator it = context.search(AuditEvent.class, qo);
while (it.hasNext()) {
AuditEvent event = (AuditEvent)it.next();
log.error("Deleting AuditEvent => ID: "+event.getId()+
", Target: " + event.getTarget()+
", Action: " + event.getAction()+
", String3: " + event.getString3());
context.removeObject(event);
}
First, try it for a single identity, and then update the string3 value based on your identity event.
If that works, you can modify it to apply to all users who are part of the event. Make sure you are not removing standard ones.
Thanks,
Raju ![]()