JQL cheat sheet
Use this Jira JQL cheat sheet as your comprehensive guide to mastering Jira Query Language for advanced searching and filtering in Atlassian’s project management tool.
Introduction to Jira Query Language (JQL)
JQL is a powerful search language specifically designed for Jira that allows users to create complex queries for issue tracking, advanced filtering, and reporting. JQL’s flexibility in Jira helps project managers and agile teams navigate large datasets.
Basic structure of JQL queries
A typical JQL query consists of the following components:
- Field: JQL fields represent different types of information, such as priority, fixVersion, or issue type.
- Operator: Operators are the core of the query, relating the field to the value, with common examples including equals (=), not equals (!=), and less than (<).
- Value and function: Values are the specific data points you’re searching for. JQL functions perform calculations or return dynamic results.
- Keywords: JQL keywords are special words with predefined meanings, such as AND and OR. They're used to construct more complex queries.
Example: project = “Marketing Campaign” AND status = “In Progress”
This structure lets users quickly formulate queries targeting specific issues or groups within Jira.
Common JQL operators
Understanding JQL operators is crucial for creating effective queries. They form the backbone of JQL, allowing users to make precise searches that can filter through large amounts of data to find exactly what they need. Common operators in JQL are:
=
: Exact match. Example:Project = “Marketing Campaign”
. This will return all issues that belong to the “Marketing Campaign” Project.!=
: Not equal to. Example:assignee != currentUser( )
. This will find all issues not assigned to the current user, helping to identify tasks that might need attention from others.AND
: Combines multiple conditions (all must be true). Example:priority = High AND status = Open
. This will return only high-priority issues in an open status, helpful in identifying critical tasks that need immediate attention.OR
: Combines multiple conditions (at least one must be true). Example:component = “User Interface” OR component = “API”
. This will find issues related to the User Interface or API components, allowing you to view related work across different system parts.IN
: Matches any value in a specified list. Example:status IN (“In Progress”, “Under Review”, “Testing”)
. This will return all issues in any of these three statuses, providing a quick way to see all active work items.
Key JQL functions and how to use them
JQL functions enhance query capabilities by allowing users to perform more complex operations, sort results, and filter based on dynamic criteria. These functions include:
-
ORDER BY
: Sorts results. Example:project = "Marketing" ORDER BY created DESC
. This will return all issues in the Marketing project, sorted by creation date from newest to oldest, allowing you to identify the most recent tasks quickly. WAS
: Finds issues that were in a particular state. Example:status WAS "Resolved" AND status = "Open."
This will find all issues that were resolved but have since been reopened, helping to track recurring problems.CHANGED
: Identifies issues modified within a timeframe. Example:status CHANGED AFTER -1w.
This will return all issues whose status has changed in the last week, useful for reviewing recent progress or changes in your project.MEMBERSOF
: Filters by group membership. Example:assignee IN MEMBERSOF("developers")
. This will find all issues assigned to anyone in the "developers" group, allowing you to see the workload across a team.
JQL examples for common Jira use cases
Here are a few ways you can use JQL in Jira.
- Find all high-priority issues assigned to you:
priority = High AND assignee = currentUser()
- List overdue issues in a specific project:
project = "Customer Support" AND duedate < now() AND status != Closed
- Show recently created issues:
created >= -7d ORDER BY created DES
Advanced JQL techniques
Use advanced search with JQL to leverage custom fields and complex queries.
- Using custom fields:
"Custom Field Name" ~ "search term"
. Use JQL to search within custom fields, allowing for more tailored and specific queries based on your business’s unique data structure. - Subqueries:
project IN subTaskIssueTypes() AND assignee = currentUser()
. Use JQL to create nested queries, enabling you to filter issues based on the results of another query, which is particularly useful for complex hierarchical relationships in your projects. - Specific issue types:
issuetype = Epic AND status != Done
. Use JQL to target particular issue types and their statuses, helping you to track and manage specific categories of work across your projects.
Becoming a JQL expert
With this Atlassian JQL cheat sheet, you'll be well-equipped to navigate advanced search with JQL and enhance your project management skills.
Mastering JQL allows you to gain key project insights and answer crucial questions relevant to your team. The three flavors of search in Jira — quick, basic, and advanced — help you find crucial information about your projects. Plus, query results can be saved and used as filters and views across Jira, including boards.