Hello All,
We are working with two identity sources: Employee Auth and Functional Auth. The Functional Auth source contains functional accounts that are actually owned by employees. (but we are treating them as an Identity rather than treating it as an account of the employee).
A challenge we’re facing is that the Functional Auth source does not include an email address for these functional identities. However, it does include an attribute called ownerUin
, which represents the unique ID of the employee who owns the functional account.
This ownerUin
value corresponds to the userLogin
attribute in the Employee Auth source. The userLogin
is effectively the username (or UID) for the employee’s identity profile.
To populate the email address for the functional identity, we plan to:
- Retrieve the
ownerUin
from the functional identity. - Search for an employee identity in the Employee Auth source where
userLogin
matches theownerUin
. - If a match is found, extract the email address from the employee profile.
- Map this email address to the corresponding functional identity.
We have written a rule, Identity Attribute Rule to meet this use case, but the rule seems to be not working. Below is the rule logic. Please let me know if this usecase can be achieved, if yes then how? Can this be done using a Transform? What exactly is wrong in the below rule?
import sailpoint.rule.Identity;
import sailpoint.object.;
import sailpoint.api.;
import sailpoint.rule.IdnRuleUtil;
import java.util.;
import sailpoint.rule.;
String email = null;
String OwnerUIN = null;
log.error (“identity attribute rule started”);
OwnerUIN = identity.getAttribute( “ownerUin” );
log.error(“OwnerUIN is:” + OwnerUIN);
if( OwnerUIN != null) {
sailpoint.rule.Identity foundIdentity = idn.getIdentityById(“OwnerUIN”);
if( foundIdentity != null) {
log.error(“identity found”);
Map attributesMap = foundIdentity.getAttributes();
email = attributesMap.get(“email”);
log.error(“email from the IF loop is:” + email);
}
else {
email = “NO Identity Found”;
}
}
else{
email = “NO Email From Rule”;
log.error(“email from else loop is:” + email);
}
return email;