Swiftorial Logo
Home
Swift Lessons
Matchups
CodeSnaps
Tutorials
Career
Resources

Jira Query Language (JQL) Tutorial

Introduction to JQL

Jira Query Language (JQL) is a powerful tool provided by Jira that allows users to create and execute complex queries to find specific issues within their projects. JQL is similar to SQL but is designed specifically for Jira. By using JQL, you can filter issues based on various criteria such as project, issue type, status, assignee, and more.

Basic JQL Syntax

At its core, a JQL query consists of a field, an operator, and a value. Here is the basic syntax:

field operator value

For example, to find all issues in the project "MyProject", you would use the following query:

project = MyProject

Common Operators

JQL supports a variety of operators to refine your queries. Here are some of the most common ones:

  • = : Equal to
  • != : Not equal to
  • > : Greater than
  • >= : Greater than or equal to
  • < : Less than
  • <= : Less than or equal to
  • IN : In a list of values
  • NOT IN : Not in a list of values
  • ~ : Contains
  • !~ : Does not contain

Advanced JQL Functions

JQL provides several functions to perform advanced queries. Here are some examples:

Using the WAS Operator

The WAS operator is used to find issues that were in a particular state at some point. For example, to find issues that were in the "In Progress" status:

status WAS "In Progress"

Using the CHANGED Operator

The CHANGED operator is used to find issues where a field has changed. For example, to find issues where the status changed:

status CHANGED

Combining Multiple Criteria

JQL allows you to combine multiple criteria using the AND and OR operators. For example, to find issues in the project "MyProject" that are assigned to "JohnDoe" and are in the "Open" status:

project = MyProject AND assignee = JohnDoe AND status = Open

Sorting Results

You can also sort the results of your JQL query using the ORDER BY clause. For example, to sort issues by priority in descending order:

project = MyProject ORDER BY priority DESC

Saving and Sharing Queries

Once you have created a JQL query, you can save it for future use and share it with your team. To save a query, click on the "Save as" button in the Jira issue navigator. To share a query, copy the URL from the browser's address bar and share it with your team members.

Examples of Advanced Queries

Finding Issues Created in the Last 7 Days

created >= -7d

Finding Issues Due in the Next 5 Days

due <= 5d

Finding Issues with Specific Labels

labels IN (label1, label2)