IQL to compare attribute in object to Attribute in referenced object

Richard Morris
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
May 10, 2022

I'd like to be able to run an IQL Query to determine where i have mismatched attribute values between referenced objects. 

I have a Monitor object, and a Computer object. 

I have a query which returns all Monitors that have a Computer linked to them as an inbound reference. 

object HAVING inboundReferences(objectType = Computer) AND objectType = Monitor

 

I want to be able to add a comparison clause to say of those 'linked assets' also  " where monitor.site name != computer.site name"

so only show me monitors which are linked to a computer, but where the site name doesnt match the computer site name. 

1 answer

0 votes
Phil Patrick September 21, 2022

I have exactly the same problem, where I need an IQL to return all computer objects where the department attribute doesn't match the referenced user objects department field. Tying to use dot notation as per the documentation doesn't seem to work:

ObjectType = Computer AND Department != "Users.Department"

Any suggestions would be gratefully recieved

Phil Patrick September 21, 2022

Following the format a little closer as stated in the advanced IQL searching docs, as far as I can tell the query should be:

<parent referenced attribute name>.<attribute in the referenced object> <operator> <value>

So in my case with the parent attribute being "Primary User" (referenced to the users object) and the attribute in the users object being Department. And the value being the Department field in my parent object:

"Primary User".Department != Department

This however still returns objects where the parent Department matches the referencesd primary users Department.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events