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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,414,268
Community Members
 
Community Events
170
Community Groups

IQL in JQL statement

Hi, 

I need to query tickets where an object is selected (via custom field), with a specific attribute of an Insight object.

Some context: 

We've set up "Categories" with multiple levels. Those levels are linked to each other by an attribute "Predecessor". The value for the attribute "Predecessor" is the another Insight object (Category) on a higher level.

F.ex level 1 = IT hardware, level 2 = Computer (&predecessor = IT hardware) & level 3 = Processor (& predecessor = Processor)

 A user will fill on his category on the lowest level, but their might be multiple lower levels linked to a higher level. In our query, we want to view all tickets of level 2, including the related tickets of level 3.

TLDR; I want to add an (Insight) attribute as a search parameter in JQL statement.

 

I've tried multiple queries (to retrieve the related tickets of level 2) but no success yet. Queries I tried:

  • "Category" in iqlFunction("Predecessor = 'IT Hardware'")
  • "Category" in iqlFunction("Predecessor.\"Categories\" = \"IT HARDWARE\")
  • "Category" in iqlFunction(object HAVING outboundReferences("Name" = IT Hardware))
  • "Category" in iqlFunction("Predecessor" IN ("ICT-84484"))

 

Example of a category in Insight: 

Schermafbeelding 2021-06-18 154843.jpg

2 answers

2 accepted

4 votes
Answer accepted

Try

Category in iqlFunction('Name = "IT Hardware" OR Predecessor = "IT Hardware"')

or

Category in iqlFunction("Name = \"IT Hardware\" OR Predecessor = \"IT Hardware\"")

From a quote/escaping point of view:

  • The outer quotes are interpreted by JQL. JQL accepts both single or double quotes for function parameters
  • The inner quotes are interpreted by insight IQL and only double quotes are allowed. So if you used double quotes for the outer quotes, then you must escape the inner quotes.

AS for the IQL logic, the first part (Name = "IT Hardware") will get you all the issues linked directly to your level 2. And the second part of the OR will get you all the issues in the Third level if the Predecessor (second level) is a match.

Thank you Peter for the clear explanation. This worked. 

0 votes
Answer accepted

Already got a solution myself (for those who encounter the same issue): 

"Category" in iqlFunction("Object HAVING outboundReferences(Key = \"OBJECTKEYOFHIGHERLEVEL\")")

 

This works, but a method via the attribute of an object would be more scalable, so other solutions are still welcome!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS

Atlassian Community Events