Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Snippet Library: JQL - Single and Multiple Clauses

Let’s get started with some easy queries that build on each other. Start with one clause, test it to make sure it returns the expected results, than keep adding additional clauses until you get to the information you’re looking for.

Single clauses

Items in spaces

Items in one or more spaces. Use a space’s key (Ex: DEV) or long name (Ex: Development).

  • project = DEV

  • project = Development

  • project in (Development, Mobile)

Items in (or not in) a specific space category. I love the “category” clause because it includes or excludes lots of items at one time.

  • category = Department

  • category != Department

  • category is not empty

Items of a type

Items of a specific work type.

  • type = Bug

Use the built-in subtaskIssueTypes function to return items of any child work type.

  • type in subtaskIssueTypes()

Multiple clauses

You can combine multiple search clauses by adding “AND” or “OR” between them. Add as many clauses as you need to get the data you’re after.

  • type = Bug AND status = Done

Next, try changing “AND” to “OR” to see how that affects the results. In the example, the OR clause means all Bugs will be returned plus all items in the Done status will also be returned. The scope of an “OR” query is much larger.

  • type = Bug OR status = Done

Use the was or changed operator to find items that were previously in a state.

  • type = Bug AND status WAS Done

  • type = Bug AND status WAS Done AND status = Reopened

  • type = Bug AND status CHANGED AFTER -2w

  • type = Bug AND status CHANGED TO "On Hold" DURING ("2026/01/01", "2026/12/31")

  • type = Bug AND status WAS "On Hold" DURING ("2026/01/01", "2026/12/31")

Clause Precedence

Use parenthesis symbols to group clauses and enforce precedence. This example returns all Bugs in either of the specified statuses.

  • type = Bug AND (status = Open OR status = In Progress”)

This next example, without parenthesis, is evaluated left to right and returns all Bugs in the first status and items of all types in the second status. The scope of this query is much larger.

  • type = Bug AND status = Open OR status = In Progress


Back to intro or article list

0 comments

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events