Audit Event for Attribute Change

Hello,

I have a requirement to create an Audit event when a user’s particular identity Attribute changes. There is an mover event already existing that triggers when user’s department attribute changes. Can I create another mover event and customize the workflow to create an Audit event for the attribute change

Hi @MakileshP ,

Is your requirement is only to create an audit event for a particular Identity attribute change or is the more to your requirements?

Yes, I need to create only audit event for the identity attribute change. No additional requirements

I would recommend you to create a listener rule and attach the listener rule to the identity attribute and create an audit event.
So whenever that attribute change an Audit event is created

Refer to the sample code below:

import sailpoint.server.Auditor;
import sailpoint.object.AuditEvent;
 
  String action = "manager-change";
 
  if(newValue==null && oldValue!=null ){
      identity.setAttribute(attributeName,oldValue);
}
  else if (newValue!=null && newValue!=oldValue) {
    AuditEvent event = new AuditEvent();
    event.setSource("Attribute Change");
    event.setTarget(identity.getName());
    event.setAction(action);
    event.setString1("attributeName = " + attributeName);
    event.setString2("oldValue = " + oldValue);
    event.setString3("newValue = " + newValue);
 
    context.saveObject(event);
    context.commitTransaction();
  }