Tech

JQL cheat sheet

JQL cheat sheet. Explore our ultimate quick reference for JQL.

This cheat sheet provides an overview of Jira Query Language (JQL) and its usage in searching and filtering issues in Jira. It includes essential fields, operators, keywords, functions, and example queries to help you create powerful JQL queries.

Fields

Common Fields

  • Assignee: The user assigned to the issue.
  • Reporter: The user who reported the issue.
  • Status: Current status of the issue (e.g., Open, In Progress).
  • Priority: Priority level of the issue.
  • Project: Project that the issue belongs to.
  • Created: The date when the issue was created.
  • Resolution: The resolution status of the issue.
  • Issue Key: The unique identifier of the issue.

Custom Fields

  • Any custom fields created by your Jira administrator can be used in queries.

Operators

Basic Operators

  • = : Equals
  • != : Does not equal
  • > : Greater than
  • < : Less than
  • >= : Greater than or equal to
  • <= : Less than or equal to
  • ~ : Contains (~ for text fields)
  • !~ : Does not contain
  • in : Within a list of values
  • not in : Not within a list of values
  • is : Is (used with empty or null)
  • is not : Is not (used with empty or null)
  • was : Previously was
  • was not : Previously was not
  • changed : Value has changed

Special Operators

  • AND : Combine multiple conditions
  • OR : Either of multiple conditions
  • NOT : Negates a condition
  • ORDER BY : Order the results by a specific field (e.g., ORDER BY created DESC).

Keywords

  • EMPTY: Checks if a field is empty.
    • resolution is EMPTY
  • NULL: Checks if a field has a null value.
    • duedate is NULL
  • ORDER BY: Sorts the results.
    • ORDER BY priority DESC

Functions

Date Functions

  • startOfDay(), startOfWeek(), startOfMonth(), startOfYear(): Start of the respective period.
  • endOfDay(), endOfWeek(), endOfMonth(), endOfYear(): End of the respective period.
  • now(): The current date and time.
  • currentUser(): The currently logged-in user.

User Functions

  • membersOf(group): Issues where the user is a member of a specific group.
  • issueHistory(): Issues that have a specific history of changes.
  • watchedIssues(): Issues watched by the current user.

SLA Functions

-“Time to resolution” = running(): Issues where the SLA clock is running

  • “Time to resolution” = pasued(): Issues where the SLA cycle is paused
  • “Time to resolution” = completed() : Issues where the SLA cycle is complete
  • “Time to resolution” > elapsed("4h"): Issues that have been waiting for a resolution for more than 4 hours
  • “Time to resolution” < remaining("2h"): Issues that will breach their resolution target within the next 2 hours
  • “Time to resolution” = breached(): Issues where the last SLA cycle has failed to meet its target goal
  • “Time to resolution” = everBreached(): Issues that have failed to meet their target goal

Examples

Find Issues Assigned to Current User

  assignee = currentUser()

Find Issues Created This Month

  created >= startOfMonth()

Find Overdue Issues

  duedate < now()

Search Text with Wildcards

  text ~ "te?t"  // Matches 'test', 'text', etc.

Complex Query Example

  project = "ProjectName" AND status = "Open" AND priority in (High, Highest) ORDER BY created DESC

Tips and Sources

Useful Tips

  • Enclose text searches in double quotes to match exact phrases.
  • Use ~ for fuzzy searches, e.g., text ~ "roam~".
  • Use wildcard searches to match partial words, e.g., text ~ "win*".

Sources