Skip to content

Instantly share code, notes, and snippets.

@jeffbryner
Created June 19, 2025 17:02
Show Gist options
  • Select an option

  • Save jeffbryner/23165528e7e3e6c61c4ccd593543aa4f to your computer and use it in GitHub Desktop.

Select an option

Save jeffbryner/23165528e7e3e6c61c4ccd593543aa4f to your computer and use it in GitHub Desktop.
JQL reference

JQL Structure The basic structure of a JQL query consists of three components:

Field: Refers to the Jira field that you want to search for. Examples include:

Assignee, Affected version, Attachments, Comment, Component, Created, Creator, Description, Due, Epic link, Filter, Fix version, Issue key, Labels, Last viewed, Priority, Project, Reporter, Resolved, Sprint, Status, Summary, Text, Time spent, Voter, Watcher, custom field – Any custom field defined by the administrator and accessible to the user

Operator: Specifies the comparison operator that you want to use to compare the field to the value. Examples of operators include:

=, !=, >, <, >=, <=, , !, IN, NOT IN, IS, IS NOT, WAS, WAS NOT, WAS IN, WAS NOT IN, CHANGED

Value: Refers to the value that you want to compare the field against. You could also use some pre-built functions to return dynamic values, these functions include:

Time related: startOfDay/Week/Month/Year, endOfDay/Week/Month/Year, lastLogin(), now(), currentLogin()

People related: currentUser(), membersOf()

Issue related: issueHistory() openSprints() watchedIssues() myApproval() myPending()

Keyword: To perform complex searches, the following keywords help link search clauses together “AND”, “OR” and “IS”

It's important to note that JQL is case-insensitive and can use parentheses to group clauses, allowing for more complex queries. Additionally, JQL supports functions that can be used to search for issues with certain attributes or characteristics.

Here are a couple of examples

JQL query searches for all open issues in the "Acme" project: project = Acme AND status != Closed

In this query, "project" is the field, "=" is the operator, and "Acme" is the value. The "AND" operator is used to combine two clauses: the project is "Acme," and the status is not "Closed." together

Search for all issues in a specific project and with a specific status: project = "Acme Project" AND status = "In Progress"

This query will find all issues in the "Acme Project" that are currently in the "In Progress" status.

Search for all issues created in the last 7 days: created >= -7d

This query will find all issues created within the last 7 days.

Search for all issues with a certain label: labels = "security-issue"

This query will find all issues with the "security-issue" label.

Search for all issues of a certain type and with a certain resolution: issuetype = Bug AND resolution = "Cannot Reproduce"

This query will find all bugs that have been marked with the "Cannot Reproduce" resolution.

Search for all issues containing a specific keyword in the summary or description: text ~ "error message"

This query will find all issues that contain the phrase "error message" in the summary or description.

Search for the most recent issues in a project project = JT ORDER BY created DESC, max_results=1

This query will find the most recent issue in the "JT" project. max_results can be used to limit the number of results returned.

Reserved characters, term modifiers etc.. to be aware off In JQL there are several reserved characters and words that have special meaning and are used to build queries. These include:

Reserved Characters:

Parentheses: () - Used to group clauses in a query

Quotation marks: "" - Used to enclose phrases or words that have spaces in them

Asterisk: * - Used as a wildcard to represent any number of characters in a search

Question mark: ? - Used as a wildcard to represent a single character in a search

Boolean operators: AND, OR, NOT - Used to combine multiple search criteria

Reserved Words:

a, and, are, as, at, be, but, by, for, if, in, into, is, it, no, not, of, on, or, s, such, t, that, the, their, then, there, these, they, this, to, was, will, with

Term Modifiers: Replace single character with ? example - m?t

Replace multiple characters with * example - win*

Add ~ to the end of a single term e.g. marry~

Add ~ to the beginning of a single term e.g. ~marry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment