The Insight Query Language is something that you can use in different places in Insight. The IQL will also be improved more and more and used in more places within Insight. Below, we will explain how to use it and give you some examples.
Expression containing space has quote surrounded like "Mathias Edblom"
The attribute in the IQL is case sensitive!
|objectType||You can limit the search result to a specific object type, e.g. objecttype = Servers|
|objectTypeId||You can limit the search result on object typ ids like objectTypeId in (1, 2)|
|anyAttribute||You can search on any attribute like: "anyAttribute = 126.96.36.199"|
|object||Limit the search to the object, e.g. "object having inboundReferences()"|
|EQUAL||=||The value is equal (not case sensitive) to input|
|LESS_THEN||<||The value is less then input|
|MORE_THEN||>||The value is more then input|
|LESS_THEN_AND_EQUAL||<=||The value is less or equal then value|
|MORE_THEN_AND_EQUAL||>=||The value is more or equal then value|
|LIKE||like||The input is a subset of value|
|NOT_LIKE||not like||The input does not contain the value|
|IN||in||The input is a set of values|
|NOT_EQUAL||!=||The value is not equal to input|
|NOT_IN||not in||The input is not a set of values|
|STARTS_WITH||startswith||The input starts with input|
|ENDS_WITH||endswith||The input ends with input|
|IS||is||The input is something or not.|
It followed by "empty" or "not empty". It represents if a value is existing or not.
|OUTBOUND_REFERENCE||.||The attributes reference attribute is queried|
|STRICT_EQUAL||==||The value is strict (case sensitive) equal to input|
|HAVING||having||The input is having a property like inbound references|
|NOT HAVING||not having||The input is not having a property like outbound references|
You may use AND to combine IQL expressions. OR is not supported as of today.
Functions are used as the value in the above IQL syntax. They supply a dynamic values.
We use m for minutes, h for hours, d for days and w for weeks to represent relative time, e.g. Created > "-2h 15m" gives you all objects created in the last 2 hours and 15 minutes. You may do queries as iqlFunction([offset]) so an example could be startOfDay(-3w).
You can also check for an upcoming date, as an example now(100d), which could be used to see if an license expires within an certain amount of time.
- currentUser() - Filter on any object connected to the current (logged in) user.
- currentReporter() - Filter on any object connected to current reporter in custom fields
- jiraGroup() - Filter on any object connected to a user within a specific JIRA group. E.g 'User IN jiraGroup("jira-users", "jira-administrators")'
- currentProject() - Filter on any object connected to the current project in a custom field.
The reference functions takes an IQL as an argument. The argument can be an arbitrary IQL including an IQL with reference function.
- inboundReferences(IQL) - Filter object having inbound references where the objects referencing to the object matches the IQL. E.g. object having inboundReferences() will filter all objects having inbound references since the empty IQL will match all objects. If the query is changed to object having inboundReferences(Name="My Name") all objects that is referenced by an object with the name My Name will be filtered.
- outboundReferences(IQL) - Filter object having outbound references where the referenced objects match the IQL. E.g. object having outboundReferences() will filter all objects having outbound references since the empty IQL will match all objects.
- objectTypeAndChildren(Name/id) from 4.7.1 - Filter all objects based on the object type specified by the name (or id) and it's children. E.g. objectType in objectTypeAndChildren("Object type name")
Objects containing quotes
When searching for objects containing quotes, they need to be escaped.
Let's say you have an Object name 15" Screen, to search for it escape " with \, like \"
Dot notation is used to traverse down a reference chain.
To demonstrate. Given a structure with 2 object types
|ObjectType: Employee Details|
|Name||Default string attribute|
|Using Software||Reference to object type Software|
|Name||Default string attribute|
To query object of type Employee Details using a software with status attribute missing one would query
The following screenshots show the same example.