Would you like to learn one more language? Jira Query language (JQL) is a must for everyone who wants to search data in Jira effectively. If you master it, you will be kind of Sherlock. It can be more or less straightforward for experienced users and totally mystifying for those who are new to Jira. In this article, you will find some of the most frequently used and popular queries based on research from the Atlassian Community and cases shared by our users and team members.
Are you ready to discover Jira’s secrets and puzzling stories?
Let’s kick off!
Date searches with JQL
With JQL, you can search for tasks created, updated, or resolved within a specific or relative date range. Here are some instances of date-related queries.
- Find issues that were created based on relative dates:
created >=-2w
This query will return tickets created within the last 2 weeks. You can also change it for days (e.g., -5d).
2. Find issues resolved between specific dates:
resolved >= 2024-01-01 AND resolved <= 2024-02-01
This query will return issues resolved between January 1, 2024, and February 1, 2024.
Use the correct JQL syntax → yyyy-mm-dd (to set date) or yyyy-mm-dd hh:mm (to set date and time)
For “2024-01-01”, the system internally treats this as “2024-01-01 00:00:00”.
3. Find issues updated on a specific date (January 12, 2024):
updated >= 2024-01-12 AND updated <=2024-04-13
This query will show issues updated between 12 a.m. on the 12th of January and 12 a.m. on the 13th of May.
4. Find issues due between specific dates:
due > 2023-12-01 and due < 2024-01-01
This query will show issues that had due dates in December 2023.
Status searches in Jira
5. Find issues in multiple statuses:
status IN (“Status1”, “Status2”, “Status3”)
For one particular status, put, for example, “status = In Progress”
6. Find issues where the status changed from In Progress to Done after some date.
status CHANGED FROM “In Progress” TO “Done” AFTER 2024-01-01
7. Find the list of issues where the status was Done for a current assignee during the last month.
status WAS Done AND assignee WAS currentUser() AND updatedDate >= startOfMonth(-1) AND updatedDate <= endOfMonth(-1)
Text searches with JQL
8. Find issues with the specified keyword in the summary, description, and comments.
text ~ “keyword”
If you are looking for incomplete word, for example “key” from the “keyword” in the summary, enter “summary ~ “key*”.
9. Use double quotes to search for an exact phrase.
text ~ “\”exact phrase\””
10. Specify the field you want to search in.
summary ~ “keyword”
description ~ “keyword”
comment ~ “keyword”
History searches with JQL
To search for updates that have been made in the past, you can use WAS or CHANGED operators. JQL works only for some fields with history changes, which include Assignee, Fix Version, Priority, Reporter, Resolution, and Status.
11. Find issues where the status was Done for some assignee during last year.
status WAS Done, and assignee WAS Jack DURING (“2022/01/01″,”2023/01/01”)
12. Find issues where priority changed from medium to low during the past 24 hours.
Priority CHANGED from Medium to Low DURING (-1d, now())
13. Find issues updated by some users during the past two weeks.
issuekey IN updatedBy(“Jack”, “-2w”))
How about other fields that JQL doesn’t support? Updates may include sprints, issue types, summaries, comments, due dates, and more. To see changes to these or any fields you have, you can try alternative solutions like Issue History for Jira. It is a diary of changes, and with available filters, you can search for the items you need.
Example. Get the list of issues for the specific project with due date changes for the current week + updated by a specific user.
- Filter by project and select the required one from the list.
- Select the updater.
- Set the date range (given or custom) — for example, this week.
- Add the due date field to the columns of the grid.
JQL combinations
In this section, you will find examples of JQL combinations that can be helpful in different situations.
14. Find issues currently part of an open sprint but not planned for any future sprints.
Sprint in openSprints() AND Sprint not in futureSprints()
15. Find bugs specifically in the “Development” project that are either in the “To Do” or “In Progress” status.
project = Development and type = Bug and status in(“To Do”,”In Progress”)
16. Show tickets that changed status to CLOSED in the last 24 hours.
status= “Closed” and status CHANGED DURING (-1d, now())
17. Find issues in the “MyProject” project that were created within the last 10 days and is presenting them in descending order based on their creation date.
Project = MyProject AND created > startofday(-10) order by created DESC
18. Find issues where the assignee is a specific user, and the status has changed from “Open” to “In Progress” within the last week.
Assignee = NAME AND status CHANGED FROM “Open” TO “In Progress” AFTER -1w
Takeaway
JQL (Jira Query Language) query is used to search for issues in Atlassian’s Jira software based on certain criteria. Mastering it will help you retrieve specific information, filter out irrelevant data, and focus on what’s important. A real-time summary of project status, progress, and other metrics can be obtained by utilizing JQL queries.
If you need help with a specific query, do not hesitate to contact us. You can share your case in the comments or contact our team at [email protected].
Find out more about the Issue History
Visit the app page for more information