Which IIQ version are you inquiring about?
8.3p4
Share all details about your problem, including any error messages you may have received.
I’m writing a Beanshell rule in IIQ to bulk-update a set of IT roles by adding a new entitlement from Azure AD. Here’s the high-level flow:
- Read CSV of role IDs (
id
) and names (ITRole_Names
). - Lookup each Bundle (role) by its ID and verify its name matches the CSV.
- Check whether the entitlement already exists on that role before adding it (“step 3”).
- Build and attach a new Profile constrained to the group GUID via a
CONTAINS_ALL
filter.
Note:
appName
is a variable holding the target application’s name (e.g."Azure Active Directory"
).entitlementValue
is a variable holding the GUID of the group I need to check/add (e.g."xcgdhdy-iopo-fghy-8ba3-789456"
).
Steps 1, 2, and 4 all work perfectly if I remove step 3 entirely.
What step 3 does
I need to skip any roles that already have that target entitlement. My Beanshell code for step 3 looks like this (with XML-escaped loops and logical ANDs):
// 3) Skip if entitlement already present
boolean exists = false;
List profiles = bundle.getProfiles();
for (int i = 0; i < profiles.size(); i++) {
Profile p = (Profile) profiles.get(i);
// confirm it’s our application
if (p.getApplication(appName) == null) {
continue;
}
List constraints = p.getConstraints();
for (int j = 0; j < constraints.size(); j++) {
Filter c = (Filter) constraints.get(j);
if (Filter.Operation.CONTAINS_ALL.equals(c.getOperation()) &&
((List)c.getValue()).contains(entitlementValue)) {
exists = true;
break;
}
}
if (exists) {
break;
}
}
if (exists) {
custLog.debug("Skipping entitlement on role: " + roleName);
continue;
}
The error
When IIQ compiles this rule I get:
No static field or inner class: Operation of class sailpoint.object.Filter : at Line: 81
Typed variable declaration : Error in method invocation: Method getApplication(java.lang.String) not found in class'sailpoint.object.Profile' : at Line: 72 : in file: inline evaluation of
Error in method invocation: Method getAttribute(java.lang.String) not found in class 'sailpoint.object.Filter$LeafFilter'
My asks
- Is there a simpler way in Beanshell/IIQ to detect whether a specific entitlement profile already exists on a role?
- Any corrections to my loop syntax or use of the
Filter
API that would compile cleanly?
Thanks in advance for your insights!
– Karan Gulati