Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Need help with IQL

Matt January 10, 2023

I would like to search for all object of a specific objecttype, if they only have an inbound reference from another type with a specific name.

Basically I have all my servers linked to from an IT system object representing a domain.
They are also linked to from other systems.

I want to list all the server that are only linked to by that domain IT system.

Specifically I want to find all the server that are not linked to a system, except for the domain system.


2 answers

0 votes
Taylen Wanner January 13, 2023

Not knowing how your schema is defined makes it difficult to propose the correct solution, but here is a couple of options to try. It would be determinate on whether your server is linked to your domain IT system, or if your domain IT system is linked to your server. Direction matters with IQL. Or you can you use outbound references instead. But again, direction will matter with querying links. 

This first IQL will return all objects that have an inbound reference from an object who has a name like "domainITSystemName". If you have multiple domain IT system objects, you will need to update this query with the name of each domain IT system object, so that you can find all the servers linked to each domain. 

objects having inR(Name like "domainITSystemName") 

 

This IQL will return all of your domain IT system objects that have an inbound reference. This query will be useful to see the number of inbound references are connected to your domain IT system object. IQL does not have a count function (that I have found). 

objects having inR() AND objectType = "domainITSystem" 

 

For more information, you can review the IQL documentation from Atlassian here: Advanced IQL Searching. 

Matt January 15, 2023 edited

Thanks for trying, I realise without a deeper understanding of our schema it's hard.
Essentially it's
"IT System" ---> Server

Imagine an IT Systems called "OurDomain".

When I import servers, I link them from that ITSystem.
So I'm looking for server that are only linked from that ITSystem, as they probably need linking from another systems.

I thought this would work.

> objectType = Server and object NOT HAVING inboundReferences(objectType = "IT System" and Name NOT LIKE "OurDomain") 

Servers that don't have links from Systems that are not OurDomain.

I don't think that works, I see a lot of results, need to dig in.

0 votes
Matt January 10, 2023

Is other any way to count number of inbound references in IQL?

Suggest an answer

Log in or Sign up to answer