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,360,111
Community Members
 
Community Events
168
Community Groups

The best way to search in Jira? - JQL queries

JQL (Jira query language) – is a powerful query language in Jira that helps to improve searching for necessarily issues and affects work efficiency.

You just write the values you need and get those issues that match them as a result. If you often use the same values for searching you can save it as a filter.

And if your queries are accurate and precise you can make filters that will be the basis for creating agile boards, gadgets, and reports.

The way you write a query can influence the speed and quality of your work.

We prepared some hints that help you to create queries «like a pro».

 

Operators OR and IN

It’s a common case when a user needs to find issues that have one of selected values from a list in their field.

It can be done like this: product = cookie OR product = milk OR product = jam OR product = butter, but there is a big chance to make an error or to forget something because the query is too long.

The opposite operator IN makes the query quite short. You just need to separate the values with commas: product IN (cookie, milk, jam, butter).

 

Functions

It happens quite often when users create unnecessary “individual” filters.

For example, John wants to create a filter that shows issues assigned to him. So, he writes the query assignee = John and save it as “My issues” filter. At the same time, there is already assignee = Olga filter created by Olga.

It’s not a big deal but the more filters created the harder maintaining them.

It’s better to create just one filter like assignee = currentUser(). In this case, any user sees issues assigned to them.

Another example: a user wants to see a list of issues for the current version of a product. The query fixVersion = 1.3.0 will be out of date as soon as the work under version 1.3.0 is finished. But the query fixVersion in unreleasedVersions() always gives you the list of issues that has an unreleased version of a product.

This abstract way of writing a query without strong values is called JQL functions.

There are some examples JQL functions that can be used for:

  • Searching for issues that were created during the last X;
  • Searching for all the issues that are at the same projects and leads by a specific user;
  • Searching for issues that were created by users from a selected group;

There is a list of functions in Jira that can be used for searching for information which is true for the particular present moment.

The full list of functions you can find there:

 

Project Categories

One of the underrated methods of searching but still a good one is using parameter Category. Instead of making JQL queries as: 

project = Alfa OR project = Beta OR project = Gamma

 or  

project in (Alfa, Beta, Gamma)

you can set a category for a project and use it for filtering.

For example, we have five projects. Three of them have the category “Development”, one of them – “Sales”, and the last one – “HR”. If we want to see issues for “Development” category, we write this JQL-query:

projectCategory =Development 

It’s more convenient when the number of projects is growing. There is no need in editing filters with every new project.

 

A few words about filter editing.

Jira administrators have to remember every filter. If an object is changed or deleted the filter using the object or object’s field option becomes useless or crashes.

And it’s difficult to find all of those damaged filters by yourself. The only thing you can do is waiting for users to complain about some non-working gadgets or some reports that show false data.

Another way of managing filters is using the app Subscriptions for Jira - Filter Manager.  You can find all the filters that are damaged or contain a specific part of a JQL query with it.

Administrators can operate with any filters but users can manage the filters created by them. 

Using JQL queries and functions definitely can make any work process easier, so we recommend Jira administrators to teach users at least the queries and functions we mentioned in this article.

The more correct queries the less useless work for everybody.

2 comments

We've just moved to Cloud and I have found it very difficult to find tickets which I know exist. A text search I tried gave around 700 results with the ticket I wanted at position 617. In our old Server installation (still running) it was at position 1.

Jira Cloud seems to apply a default ORDER BY Key DESC to any search. Jira Server didn't do this, and showed results sorted by best match or relevance unless you clicked a column title or added the JQL manually.

I'm familiar with JQL and use it extensively, but even if I restrict tickets to the project I know the ticket is in, the ticket I want is at the bottom of the list. Our main product is 25 years old, and the project for it has 10K tickets. Try finding tickets there.

How can I turn on best match or relevance sorting in Jira Cloud?

I agree the knowing JQL is a must for Jira Administrators and Jira Users alike. The only difference is of course the depth of this knowledge.

This knowlege is tested when you prepare for one of the Jira Atlassian Certified Professional exams. Often the preparation for JQL is underestimated (we use JQL every day right?) . This may cost the candidate a few needed points to pass.

If you are preparing yourself for any Jira ACP exam and want to get a few JQL related tips, have a look at this recently published article: https://jlabnotes.com/jira-jql-best-practices/

Using project categories described here by @Sara Ryan is one of them, but there are few more.

Like Kalin U likes this

Comment

Log in or Sign up to comment
TAGS
Community showcase
Published in Apps & Integrations

Apps for Confluence you won't want to miss: RSVP for September's Appy Hours

Calling all collaborators and Confluence users! Our Appy Hours event on September 29th features 4 presenters demoing functionality to superpower Confluence. Don't miss learning about these apps i...

117 views 0 9
Read article

Atlassian Community Events