Advanced Searching

The instructions on this page describe how to define and execute a search using the advanced search. You can also define and execute a search using the quick search or using basic searching.

What is an Advanced Search?

An advanced search allows you to use structured queries to search for JIRA issues. Your search results will be displayed in the Issue Navigator, where you can export them to MS Excel and many other formats. You can also save and subscribe to your advanced searches if you wish.

When you perform an advanced search, you are using the JIRA Query Language (JQL).

A simple query in JQL (also known as a 'clause') consists of a field, followed by an operator, followed by one or more values or functions. For example, the following simple query will find all issues in the "TEST" project:

project = "TEST"

(This example uses the Project field, the EQUALS operator, and the value "TEST".)

Be aware that it is not possible to compare two fields.

(info) JQL gives you some SQL-like syntax, such as the ORDER BY SQL keyword and ISNULL() SQL function (i.e. the NULL keyword in JQL). However, JQL is not a database query language. For example, JQL does not have a SELECT statement.

How to Perform an Advanced Search

  1. Choose Issues > Search for Issues. The issue navigator will be displayed.
    • If there are existing search criteria, click the New filter button to reset the search criteria.
    • If the Advanced link is showing, click it to switch to advanced searching.
  2. Type your query using the fields, operators and field values or functions.
  3. Click the Search button to run your query.

Performing Text Searches

You can use Lucene's text-searching features when performing searches on the following fields, using the CONTAINS operator:

The JQL field "text" as in text ~ "some words" searches an issue's Summary, Description, Environment, Comments. It also searches all text custom fields. If you have many text custom fields you can improve performance of your queries by searching on specific fields, e.g.
Summary ~ "some words" OR Description ~ "some words"

For details, please see the page on Performing Text Searches.

Using Auto-complete

As you type your query, JIRA will recognise the context and offer a list of "auto-complete" suggestions as follows:

The list of auto-complete suggestions is displayed alphabetically and includes the first 15 matches. Note that auto-complete suggestions are not offered for function parameters.

Please note:

  • If no auto-complete suggestions are offered, your administrator may have disabled the "JQL Auto-complete" feature for your JIRA instance.
  • If you prefer not to be offered auto-complete suggestions, click the "Turn off auto-complete" link below the "Query" box.

Auto-complete suggestions are not offered for all fields. Check the fields reference to see which fields support auto-complete.

Switching between 'Advanced' and 'Simple' Search

In general, a query created using 'Simple Search' will be able to be translated to 'Advanced Search' (i.e. JQL), and back again.

However, a query created using 'Advanced Search' may not be able to be translated to 'Simple Search', particularly if:

  • the query contains an OR operator (note you can have an IN operator and it will be translated, e.g. project in (A, B))
    • i.e. even though this query: (project = JRA OR project = CONF) is equivalent to this query: (project in (JRA, CONF)), only the second query will be translated.
  • the query contains a NOT operator
  • the query contains an EMPTY operator
  • the query contains any of the comparison operators: !=, IS, IS NOT, >, >=, <, <=
  • the query specifies a field and value that is related to a project (e.g. version, component, custom fields) and the project is not explicitly included in the query (e.g. fixVersion = "4.0", without the AND project=JRA). This is especially tricky with custom fields since they can be configured on a Project/Issue Type basis. The general rule of thumb is that if the query cannot be created in the 'Simple Search' form, then if it is created using 'Advanced Search' it will not be able to be translated to 'Simple Search'.

 

Setting Precedence of Operators

You can use parentheses in complex JQL statements to enforce the precedence of operators.

For example, if you want to find all resolved issues in the SysAdmin project as well as all issues (any status, any project) currently assigned to the system administrator (bobsmith), you can use parentheses to enforce the precedence of the boolean operators in your query, i.e.:

(status=resolved AND project=SysAdmin) OR assignee=bobsmith

Note that if you do not use parentheses, the statement will be evaluated left-to-right.

You can also use parentheses to group clauses, so that you can apply the NOT operator to the group.

Keywords Reference

A keyword in JQL is a word or phrase that does (or is) any of the following:

  • joins two or more clauses together to form a complex JQL query
  • alters the logic of one or more clauses
  • alters the logic of operators
  • has an explicit definition in a JQL query
  • performs a specific function that alters the results of a JQL query.

List of Keywords:

AND

Used to combine multiple clauses, allowing you to refine your search.

Note that you can use parentheses to control the order in which clauses are executed.

Examples
  • Find all open issues in the "New office" project:

    project = "New office" and status = "open"
  • Find all open, urgent issues that are assigned to jsmith:

    status = open and priority = urgent and assignee = jsmith
  • Find all issues in a particular project that are not assigned to jsmith:

    project = JRA and assignee != jsmith
  • Find all issues for a specific release which consists of different version numbers across several projects:

    project in (JRA,CONF) and fixVersion = "3.14"
  • Find all issues where neither the Reporter nor the Assignee is Jack, Jill or John:

    reporter not in (Jack,Jill,John) and assignee not in (Jack,Jill,John)

^top of keywords | ^^top of topic

OR

Used to combine multiple clauses, allowing you to expand your search.

Note that you can use parentheses to control the order in which clauses are executed.

(Note: also see IN, which can be a more convenient way to search for multiple values of a field.)

Examples
  • Find all issues that were created by either jsmith or jbrown:

    reporter = jsmith or reporter = jbrown
  • Find all issues that are overdue or where no due date is set:

    duedate < now() or duedate is empty

^top of keywords | ^^top of topic

NOT

Used to negate individual clauses or a complex JQL query (a query made up of more than one clause) using parentheses, allowing you to refine your search.

(Note: also see NOT EQUALS ("!="), DOES NOT CONTAIN ("!~"), NOT IN and IS NOT.)

Examples
  • Find all issues that are assigned to any user except jsmith:

    not assignee = jsmith
  • Find all issues that were not created by either jsmith or jbrown:

    not (reporter = jsmith or reporter = jbrown)

^top of keywords | ^^top of topic

EMPTY

Used to search for issues where a given field does not have a value. See also NULL.

Note that EMPTY can only be used with fields that support the IS and IS NOT operators. To see a field's supported operators, check the individual field reference.

(warning) EMPTY is not equivalent to NOT EQUALS (!=)

 

Examples
  • Find all issues without a DueDate:

    duedate = empty

    or

    duedate is empty

^top of keywords | ^^top of topic

NULL

Used to search for issues where a given field does not have a value. See also EMPTY.

Note that NULL can only be used with fields that support the IS and IS NOT operators. To see a field's supported operators, check the individual field reference.

Examples
  • Find all issues without a DueDate:

    duedate = null

    or

    duedate is null

^top of keywords | ^^top of topic

ORDER BY

Used to specify the fields by whose values the search results will be sorted.

By default, the field's own sorting order will be used. You can override this by specifying ascending order ("asc") or descending order ("desc").

Examples
  • Find all issues without a DueDate, sorted by CreationDate:

    duedate = empty order by created 
  • Find all issues without a DueDate, sorted by CreationDate, then by Priority (highest to lowest):

    duedate = empty order by created, priority desc
  • Find all issues without a DueDate, sorted by CreationDate, then by Priority (lowest to highest):

    duedate = empty order by created, priority asc

Ordering by Components or Versions will list the returned issues first by Project and only then by the field's natural order (see JRA-31113).

^top of keywords | ^^top of topic


Operators Reference

An operator in JQL is one or more symbols or words which compares the value of a field on its left with one or more values (or functions) on its right, such that only true results are retrieved by the clause. Some operators may use the NOT keyword.

List of Operators:

EQUALS: =

The "=" operator is used to search for issues where the value of the specified field exactly matches the specified value. (Note: cannot be used with text fields; see the CONTAINS operator instead.)

To find issues where the value of a specified field exactly matches multiple values, use multiple "=" statements with the AND operator.

Examples
  • Find all issues that were created by jsmith:

    reporter = jsmith
  • Find all issues that were created by John Smith:

    reporter = "John Smith"

^top of operators | ^^top of topic

NOT EQUALS: !=

The "!=" operator is used to search for issues where the value of the specified field does not match the specified value. (Note: cannot be used with text fields; see the DOES NOT MATCH ("!~") operator instead.)

Note that typing field != value is the same as typing NOT field = value, and that field != EMPTY is the same as field IS_NOT EMPTY.

The "!=" operator will not match a field that has no value (i.e. a field that is empty). For example, component != fred will only match issues that have a component and the component is not "fred". To find issues that have a component other than "fred" or have no component, you would need to type: component != fred or component is empty.

Examples
  • Find all issues that are assigned to any user except jsmith:

    not assignee = jsmith

    or:

    assignee != jsmith
  • Find all issues that are not assigned to jsmith:

    assignee != jsmith or assignee is empty
  • Find all issues that were reported by me but are not assigned to me:

    reporter = currentUser() and assignee != currentUser()
  • Find all issues where the Reporter or Assignee is anyone except John Smith:

    assignee != "John Smith" or reporter != "John Smith"
  • Find all issues that are not unassigned:

    assignee is not empty

    or

    assignee != null

^top of operators | ^^top of topic

GREATER THAN: >

The ">" operator is used to search for issues where the value of the specified field is greater than the specified value. Cannot be used with text fields.

Note that the ">" operator can only be used with fields which support ordering (e.g. date fields and version fields). To see a field's supported operators, check the individual field reference.

Examples
  • Find all issues with more than 4 votes:

    votes > 4
  • Find all overdue issues:

    duedate < now() and resolution is empty
  • Find all issues where priority is higher than "Normal":

    priority > normal

^top of operators | ^^top of topic

GREATER THAN EQUALS: >=

The ">=" operator is used to search for issues where the value of the specified field is greater than or equal to the specified value. Cannot be used with text fields.

Note that the ">=" operator can only be used with fields which support ordering (e.g. date fields and version fields). To see a field's supported operators, check the individual field reference.

Examples
  • Find all issues with 4 or more votes:

    votes >= 4
  • Find all issues due on or after 31/12/2008:

    duedate >= "2008/12/31"
  • Find all issues created in the last five days:

    created >= "-5d"

^top of operators | ^^top of topic

LESS THAN: <

The "<" operator is used to search for issues where the value of the specified field is less than the specified value. Cannot be used with text fields.

Note that the "<" operator can only be used with fields which support ordering (e.g. date fields and version fields). To see a field's supported operators, check the individual field reference.

Examples
  • Find all issues with less than 4 votes:

    votes < 4

^top of operators | ^^top of topic

LESS THAN EQUALS: <=

The "<=" operator is used to search for issues where the value of the specified field is less than or equal to than the specified value. Cannot be used with text fields.

Note that the "<=" operator can only be used with fields which support ordering (e.g. date fields and version fields). To see a field's supported operators, check the individual field reference.

Examples
  • Find all issues with 4 or fewer votes:

    votes <= 4
  • Find all issues that have not been updated in the past month (30 days):

    updated <= "-4w 2d"

^top of operators | ^^top of topic

IN

The "IN" operator is used to search for issues where the value of the specified field is one of multiple specified values. The values are specified as a comma-delimited list, surrounded by parentheses.

Using "IN" is equivalent to using multiple EQUALS (=) statements, but is shorter and more convenient. That is, typing reporter IN (tom, jane, harry) is the same as typing reporter = "tom" OR reporter = "jane" OR reporter = "harry".

Examples
  • Find all issues that were created by either jsmith or jbrown or jjones:

    reporter in (jsmith,jbrown,jjones)
  • Find all issues where the Reporter or Assignee is either Jack or Jill:

    reporter in (Jack,Jill) or assignee in (Jack,Jill)
  • Find all issues in version 3.14 or version 4.2:

    affectedVersion in ("3.14", "4.2")

^top of operators | ^^top of topic

NOT IN

The "NOT IN" operator is used to search for issues where the value of the specified field is not one of multiple specified values.

Using "NOT IN" is equivalent to using multiple NOT_EQUALS (!=) statements, but is shorter and more convenient. That is, typing reporter NOT IN (tom, jane, harry) is the same as typing reporter != "tom" AND reporter != "jane" AND reporter != "harry".

The "NOT IN" operator will not match a field that has no value (i.e. a field that is empty). For example, assignee not in (jack,jill) will only match issues that have an assignee and the assignee is not "jack" or "jill". To find issues that are assigned to someone other than "jack" or "jill" or are unassigned, you would need to type: assignee not in (jack,jill) or assignee is empty.

Examples
  • Find all issues where the Assignee is someone other than Jack, Jill or John:

    assignee not in (Jack,Jill,John)
  • Find all issues where the Assignee is not Jack, Jill or John:

    assignee not in (Jack,Jill,John) or assignee is empty
  • Find all issues where the FixVersion is not 'A', 'B', 'C' or 'D':

    FixVersion not in (A, B, C, D)
  • Find all issues where the FixVersion is not 'A', 'B', 'C' or 'D', or has not been specified:

    FixVersion not in (A, B, C, D) or FixVersion is empty

^top of operators | ^^top of topic

CONTAINS: ~

The "~" operator is used to search for issues where the value of the specified field matches the specified value (either an exact match or a "fuzzy" match — see examples below). For use with text fields only, i.e.:

The JQL field "text" as in text ~ "some words" searches an issue's Summary, Description, Environment, Comments. It also searches all text custom fields. If you have many text custom fields you can improve performance of your queries by searching on specific fields, e.g.
Summary ~ "some words" OR Description ~ "some words"

Note: when using the "~" operator, the value on the right-hand side of the operator can be specified using JIRA text-search syntax.

Examples
  • Find all issues where the Summary contains the word "win" (or simple derivatives of that word, such as "wins"):

    summary ~ win
  • Find all issues where the Summary contains a wild-card match for the word "win":

    summary ~ "win*"
  • Find all issues where the Summary contains the word "issue" and the word "collector":

    summary ~ "issue collector"
  • Find all issues where the Summary contains the exact phrase "full screen" (see Reserved Characters for details on how to escape quote-marks and other special characters):

    summary ~ "\"full screen\""

^top of operators | ^^top of topic

DOES NOT CONTAIN: !~

The "!~" operator is used to search for issues where the value of the specified field is not a "fuzzy" match for the specified value. For use with text fields only, i.e.:

The JQL field "text" as in text ~ "some words" searches an issue's Summary, Description, Environment, Comments. It also searches all text custom fields. If you have many text custom fields you can improve performance of your queries by searching on specific fields, e.g.
Summary ~ "some words" OR Description ~ "some words"

Note: when using the "!~" operator, the value on the right-hand side of the operator can be specified using JIRA text-search syntax.

Examples
  • Find all issues where the Summary does not contain the word "run" (or derivatives of that word, such as "running" or "ran"):

    summary !~ run

^top of operators | ^^top of topic

IS

The "IS" operator can only be used with EMPTY or NULL. That is, it is used to search for issues where the specified field has no value.

Note that not all fields are compatible with this operator; see the individual field reference for details.

Examples
  • Find all issues that have no Fix Version:

    fixVersion is empty

    or

    fixVersion is null

^top of operators | ^^top of topic

IS NOT

The "IS NOT" operator can only be used with EMPTY or NULL. That is, it is used to search for issues where the specified field has a value.

Note that not all fields are compatible with this operator; see the individual field reference for details.

Examples
  • Find all issues that have one or more votes:

    votes is not empty

    or

    votes is not null

^top of operators | ^^top of topic

WAS

The "WAS" operator is used to find issues that currently have, or previously had, the specified value for the specified field.

This operator has the following optional predicates:
  • AFTER "date"
  • BEFORE "date"
  • BY "username"
  • DURING ("date1","date2")
  • ON "date"
This operator will match the value name (e.g. "Resolved"), which was configured in your system at the time that the field was changed. This operator will also match the value ID associated with that value name too — that is, it will match "4" as well as "Resolved".

(Note: This operator can be used with the Assignee, Fix Version, PriorityReporter, Resolution and Status fields only.)

Examples
  • Find issues that currently have, or previously had, a status of 'In Progress':

    status WAS "In Progress"
  • Find issues that were resolved by Joe Smith before 2nd February:

    status WAS "Resolved" BY jsmith BEFORE "2011/02/02"
  • Find issues that were resolved by Joe Smith during 2010:

    status WAS "Resolved" BY jsmith DURING ("2010/01/01","2011/01/01")

^top of operators | ^^top of topic

WAS IN

The "WAS IN" operator is used to find issues that currently have, or previously had, any of multiple specified values for the specified field. The values are specified as a comma-delimited list, surrounded by parentheses.

Using "WAS IN" is equivalent to using multiple WAS statements, but is shorter and more convenient. That is, typing status WAS IN ('Resolved', 'Closed') is the same as typing status WAS "Resolved" OR status WAS "Closed".

This operator has the following optional predicates:
  • AFTER "date"
  • BEFORE "date"
  • BY "username"
  • DURING ("date1","date2")
  • ON "date"
This operator will match the value name (e.g. "Resolved"), which was configured in your system at the time that the field was changed. This operator will also match the value ID associated with that value name too — that is, it will match "4" as well as "Resolved".

(Note: This operator can be used with the Assignee, Fix Version, PriorityReporter, Resolution and Status fields only.)

Examples
  • Find all issues that currently have, or previously had, a status of 'Resolved' or 'In Progress':

    status WAS IN ("Resolved","In Progress")

^top of operators | ^^top of topic

WAS NOT IN

The "WAS NOT IN" operator is used to search for issues where the value of the specified field has never been one of multiple specified values.

Using "WAS NOT IN" is equivalent to using multiple WAS_NOT statements, but is shorter and more convenient. That is, typing status WAS NOT IN ("Resolved","In Progress") is the same as typing status WAS NOT "Resolved" AND status WAS NOT "In Progress".

This operator has the following optional predicates:
  • AFTER "date"
  • BEFORE "date"
  • BY "username"
  • DURING ("date1","date2")
  • ON "date"
This operator will match the value name (e.g. "Resolved"), which was configured in your system at the time that the field was changed. This operator will also match the value ID associated with that value name too — that is, it will match "4" as well as "Resolved".

(Note: This operator can be used with the Assignee, Fix Version, PriorityReporter, Resolution and Status fields only.)

Examples
  • Find issues that have never had a status of 'Resolved' or 'In Progress':

    status WAS NOT IN ("Resolved","In Progress")
  • Find issues that did not have a status of 'Resolved' or 'In Progress' before 2nd February:

    status WAS NOT IN ("Resolved","In Progress") BEFORE "2011/02/02"

^top of operators | ^^top of topic

WAS NOT

The "WAS NOT" operator is used to find issues that have never had the specified value for the specified field.

This operator has the following optional predicates:
  • AFTER "date"
  • BEFORE "date"
  • BY "username"
  • DURING ("date1","date2")
  • ON "date"
This operator will match the value name (e.g. "Resolved"), which was configured in your system at the time that the field was changed. This operator will also match the value ID associated with that value name too — that is, it will match "4" as well as "Resolved".

(Note: This operator can be used with the Assignee, Fix Version, PriorityReporter, Resolution and Status fields only.)

Examples
  • Find issues that do not have, and has never had, a status of 'In Progress':

    status WAS NOT "In Progress"
  • Find issues that did not have a status of 'In Progress' before 2nd February:

    status WAS NOT "In Progress" BEFORE "2011/02/02"

^top of operators | ^^top of topic

CHANGED

The "CHANGED" operator is used to find issues that have a value which had changed for the specified field.

This operator has the following optional predicates:

  • AFTER "date"
  • BEFORE "date"
  • BY "username"
  • DURING ("date1","date2")
  • ON "date"
  • FROM "oldvalue"
  • TO "newvalue"
Examples
  • Find issues whose assignee had changed:

    assignee CHANGED
  • Find issues whose status had changed from 'In Progress' back to 'Open':

    status CHANGED FROM "In Progress" TO "Open"
  • Find issues whose priority was changed by user 'freddo' after the start and before the end of the current week.

    priority CHANGED BY freddo BEFORE endOfWeek() AFTER startOfWeek()

^top of operators | ^^top of topic

Fields Reference

 

Last modified on May 4, 2014

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.