Can anyone please help with run rule for below use case ?
Personal Number from Workday to be updated in mobilePhone identity attribute with below logic for only India and Taiwan Users. Check the identity mapping config for mobilePhone identity attribute and implement below logic without impacting the existing logic
a. For any new users where mobilePhone identity attr is null (Oldvalue is null)
i. mobilePhone identity attribute should be updated with Personal Number from Workday
ii. optInApplication should be set with value “IIQ_BCP:TRUE|IIQ_AD:FALSE”
b. For existing users where oldValue of mobileNumber is NUMBER1/NULL and newValue of mobileNumber is NUMBER2 (Difference in old and new value)
i. mobilePhone identity attribute should be updated with new Personal Number from Workday
This Encountered: ;
leads me to believe you have a function call with the incorrect number of arguments. Essentially it’s saying that it came across a semi-colon before it expected to. I can’t really reference the line numbers since the code displayed is run together.
I am getting this error for Identity Attribute Rule - error declaring bean: identity : bsh.EvalError: Can’t assign sailpoint.object.Identity to java.lang.String : at Line: -1 : in file: :
Based on your latest error, this one states that EntityValue is wrongly stated. I can’t tell from my end what exactly is the issue, however my advice is to go over the sintax within your java code. Do a debugging approach
import sailpoint.object.Link;
import sailpoint.object.Identity;
import sailpoint.tools.Util;
import java.util.List;
String formattedPhone = null;
// Ensure identity object exists
if (identity != null && "170845".equalsIgnoreCase((String)identity.getAttribute("employeeId"))) {
List links = identity.getLinks();
if (links != null && !links.isEmpty()) {
for (Link link : links) {
if ("HR-Workday-WebService".equals(link.getApplicationName())) {
String country = link.getAttribute("COUNTRY");
String phone = link.getAttribute("Personal_Phone__c");
if (!Util.isEmpty(phone) && !Util.isEmpty(country)) {
// Clean up phone string
phone = phone.replaceAll("[\\s()-]", "");
// Format for India
if ("IND".equalsIgnoreCase(country) && phone.length() >= 10) {
formattedPhone = phone.substring(0, 3) + "-" + phone.substring(3);
}
// Format for Taiwan
else if ("TWN".equalsIgnoreCase(country) && phone.length() >= 10) {
formattedPhone = phone.substring(0, 4) + "-" + phone.substring(4);
}
if (!Util.isEmpty(formattedPhone)) {
// Set another attribute if needed (but this rule must return ONE value)
// identity.setAttribute("optInApplication", "IIQ_BCP:TRUE|IIQ_AD:FALSE");
return formattedPhone;
}
}
}
}
}
}
return null;
Check this rule and modify as per your requirements also check if you have "employeeId" defined as an attribute and mapped properly