Listener rule to send OldValues when new value is null

Hello,

Need some help with Listener rules.
We use IIQ 8.4.
I am trying to send oldValue if the new value is null in the listener rule. here is the piece of code i have come up with.

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

log.error(“First name old value:::”+oldValue);
log.error(“First name new value:::”+newValue);

if (newValue == null && oldValue != null){
log.error(“New value null and old value is not null”);
if (identity.getType()!=null){
String usrIdentityType = identity.getType();
if (usrIdentityType.equalsIgnoreCase(“contractor”) || usrIdentityType.equalsIgnoreCase(“external user”) ){
log.error(“Type is not null if condition true:::”+usrIdentityType);
newValue = oldValue;
log.error(“Final First name old value:::”+oldValue);
log.error(“Final First name new value:::”+newValue);
}
}
}

When i send new value as null through aggregation, it prints the old value as new value in the last log.error statement however newValue is still being sent as null and it’s getting removed from Authoritative source and identity cube.

Please review and let me know if i miss anything.

Listener rule is usually used to detect any changes in attribute values and if you need to take any action based on change you will need to call the Listener workflow.
It seems you need to set attribute based on a particular condition and so its better you create a Source mappings Application rule or Global rule to handle this.

Hello Sanjeev,

We have source mappings. In some cases, we won’t be getting the data for some users after a few months. In such cases, we want to retain whatever is there in SailPoint so i was thinking to use listener rule and pass oldvalue as new value. Any additional info to get this done would be rally helpful.

You can try to do that using a global rule for your source mapping. I see oldValue as one of the arguments and you have identity as another argument which can be used to get the application attribute you want to check and set this identity attribute to