JQL Cheat Sheet

In Jira

JQL, or Jira Query Language, is a powerful tool that allows users to search and filter issues in Jira. It is a simple yet flexible language that enables users to create complex queries to find the exact information they need. JQL is a key feature of Jira, a popular project management tool used by teams to track and manage their work.

With JQL, users can search for issues based on various criteria such as issue type, status, priority, assignee, and more. They can also use operators such as “AND,” “OR,” and “NOT” to create more complex queries. JQL also supports functions that allow users to search for issues based on time, dates, and other custom fields.

One of the benefits of using JQL is that it saves time and effort by allowing users to quickly find the information they need. It also helps teams to stay organized and on top of their work by providing a way to filter and sort through large amounts of data.

This cheat sheet provides an extensive list of JQL commands and their usage.

Basic JQL Commands

CommandDescription
project = <project>Returns all issues in the specified project
issuekey = <issuekey>Returns the issue with the specified key
assignee = <user>Returns all issues assigned to the specified user
reporter = <user>Returns all issues reported by the specified user
status = <status>Returns all issues with the specified status
priority = <priority>Returns all issues with the specified priority
issuetype = <issuetype>Returns all issues with the specified issue type
created = <date>Returns all issues created on the specified date
updated = <date>Returns all issues updated on the specified date
resolution = <resolution>Returns all issues with the specified resolution
text ~ ""<text>""Returns all issues containing the specified text in the summary, description, or comments

Advanced JQL Commands

CommandDescription
project in (<project1>, <project2>)Returns all issues in the specified projects
issuekey in (<issuekey1>, <issuekey2>)Returns the issues with the specified keys
assignee in (<user1>, <user2>)Returns all issues assigned to the specified users
reporter in (<user1>, <user2>)Returns all issues reported by the specified users
status in (<status1>, <status2>)Returns all issues with the specified statuses
priority in (<priority1>, <priority2>)Returns all issues with the specified priorities
issuetype in (<issuetype1>, <issuetype2>)Returns all issues with the specified issue types
created >= <date>Returns all issues created on or after the specified date
created <= <date>Returns all issues created on or before the specified date
updated >= <date>Returns all issues updated on or after the specified date
updated <= <date>Returns all issues updated on or before the specified date
resolution in (<resolution1>, <resolution2>)Returns all issues with the specified resolutions
text ~ ""<text1>"" AND text ~ ""<text2>""Returns all issues containing both specified texts in the summary, description, or comments
text ~ ""<text1>"" OR text ~ ""<text2>""Returns all issues containing either specified text in the summary, description, or comments
text ~ ""<text>"" AND status = <status>Returns all issues containing the specified text and with the specified status

JQL Functions

FunctionDescription
now()Returns the current date and time
startOfDay()Returns the start of the current day
endOfDay()Returns the end of the current day
startOfWeek()Returns the start of the current week
endOfWeek()Returns the end of the current week
startOfMonth()Returns the start of the current month
endOfMonth()Returns the end of the current month
startOfYear()Returns the start of the current year
endOfYear()Returns the end of the current year
dateCompare(<date1>, <date2>)Compares two dates and returns -1 if date1 is before date2, 0 if they are the same, and 1 if date1 is after date2
dateDiff(<date1>, <date2>)Returns the difference in days between two dates
dateAdd(<date>, <number>, <unit>)Adds a specified number of units (days, weeks, months, years) to a date
dateSubtract(<date>, <number>, <unit>)Subtracts a specified number of units (days, weeks, months, years) from a date

JQL Operators

OperatorDescription
=Equal to
!=Not equal to
<Less than
>Greater than
<=Less than or equal to
>=Greater than or equal to
ANDLogical AND
ORLogical OR
NOTLogical NOT
()Grouping

Conclusion

This cheat sheet provides a comprehensive list of JQL commands, functions, and operators that can be used to search for issues in Jira. By using these commands, you can quickly and easily find the issues you need to work on.

Reference:

https://support.atlassian.com/jira-service-management-cloud/docs/use-advanced-search-with-jira-query-language-jql/

# #