Which IIQ version are you inquiring about?
[8.4p1]
Hey guys,
Is it possible to write a filter for a Managed Attribute that filters based on the attributes?
I have managed to filter on requestable and then only log those that I care about (i.e. those that have approverSpecific1 != null)
QueryOptions query = new QueryOptions();
query.addFilter(Filter.contains("ManagedAttribute.requestable", true));
List entitlements = context.getObjects(ManagedAttribute.class, query);
for(ManagedAttribute ma : entitlements) {
if(ma.getAttribute("approverSpecific1") != null) {
clog.debug("ma: " + ma.getAttribute("approverSpecific1"));
}
}
but im wondering, can I filter directly on the approverSpecific1 attribute? Or any other attribute for that matter, for example cn?
hi @filip_johansson
You’re on the right track with your current approach.
In IIQ, QueryOptions
only supports filtering on indexed and top-level attributes of the object model. Unfortunately, attributes like approverSpecific1
(which are typically stored in the attributes
map of a ManagedAttribute
) aren’t directly filterable in the query itself.
So no, you can’t do something like:
query.addFilter(Filter.notnull("ManagedAttribute.approverSpecific1"));
That won’t work because approverSpecific1
isn’t a first-class property in the object schema — it’s just a key in a map.
Your current approach is actually the correct one:
- Filter on something indexable (like
requestable
).
- Loop through the results.
- Check the custom attribute (
approverSpecific1
) in code.
If performance becomes a concern, you could consider:
- Adding a rule or task that flags or tags these attributes in a more queryable way.
- Using a custom object or extending the schema (if you’re comfortable with that level of customization).
Thank you, that is what I figured.
This in itself is an optimization process to populate a custom object with information regarding workgroups, their members and what entitlements they are assigned to. So this task will be running quite sparsely, the performance will likely not be a big issue.
I’ll stick to filtering on requestable for now, and if it turns out it takes way too long time, I’ll think of optimization concerns at that point. Thank you 
1 Like