Filter entitlement from bundles

@maniG if you need all entitlement from bundle then you can make method like below

public List getgroupsfromRole(SailpointContext ctx, List roles) {
List groups = new ArrayList();
for(String role : roles) {
   Bundle roleObj = ctx.getObjectByName(Bundle.class, role);
   roleObj.load();

   List reqRoles = roleObj.getRequirements();
   for (Bundle itR : reqRoles){
	List p = itR.getProfiles();
        for(Profile pr : p) {
		  List listF = pr.getConstraints();
          int size = listF.size();
          for(int i = 0; i < size; i++) {
            if(listF.get(i) isntanceof LeafFilter) {
              LeafFilter filter = (LeafFilter) listF.get(i);
              Object value = filter.getValue();
              if(value instanceof ArrayList) {
                ArrayList listEnt = new ArrayList();
                listEnt = (ArrayList) value;
                groups.addAll(listEnt);
              }
            }
          }
        }
    }
}
 return groups;
}

Syntax might you need to fix. but logic should be around that.

Some threads that will help

How can I find entitlement is present in any role or not - IdentityIQ (IIQ) / IIQ Discussion and Questions - SailPoint Developer Community

Entitlement Existence Check in Bundle - Error in Beanshell Rule - IdentityIQ (IIQ) / IIQ Discussion and Questions - SailPoint Developer Community

2 Likes