Jira Query Language (JQL) Tips | John's Tips 2024W21
See here for a bunch of various small Jira Query Language tips (JQL) I have come across in the past.
Table of Contents:
1. JQL Filter indentation
2. Searching for empty Labels
3. Creating a user list filter to avoid having to add/remove people to many saved filters
1. JQL Filter indentation
This one might be useful for someone with big long filters - Jira will retain the indentation or new lines you put into a saved filter.
Jira have updated since I originally found this out, and if you search first using the Basic filtering and then switch to JQL, they should automatically add search terms on new lines.
One thing to know, depending on the version of Jira you have - if you are trying to indent an existing filter to save it with indentation, you may need to mouse click to where you want to begin the newline and hit Shift + Enter
If you browse using keyboard navigation keys to where you want to indent with the new line, JIRA will show the suggestions and shift enter may not work. This also is fixed on my version, but may not be on yours.
2. Searching for empty Labels
When searching for tickets that don’t have a specific label, you need to explicitly call out that you want to find tickets that have empty labels, as well as ones that are not in your list of labels.
This JQL will NOT show empty labels:
AND labels not in (Label1, Label2, Label3)
This JQL will:
AND (labels not in (Label1, Label2, Label3) OR labels is empty)
3. Creating a user list filter to avoid having to add/remove people to many saved filters
This is a very neat trick I came across when trying to create a saved search based on the people in a team - instead of constantly updating dashboards/reports each time the team changes, you can do the following:
Create and save a filter called “Assigned to My Team” or “Assigned to team ABC” where the filter is just assignee in (user1, user2, user3...User15).
Then whenever you need to use that as part of another JQL query, you can just add it with filter = “Assigned to My Team” or whatever the filter id number is to keep it short,
created >= -30d
AND Filter = "assigned to me"
order by created DESC
Uses for this are plentiful, but imagine you are a team like a platform team and you want to single out tickets NOT raised by people on your team?
You could create a filter for:
Reporter IN (list of team members)
And then another for
Reporter NOT IN (Above filter)
Quite useful if you think of all the possibilities!
Have any more JQL tips you’d like to share! Leave a comment and I can add them to the list.
I have some other Jira and Product Operations content here if you found this useful. Please let me know if instructions here change.
For my past tips check out my past posts on Substack or check out the hashtag #JohnsTipOfTheWeek on LinkedIn.