页面树结构

本页面的内容:

什么是高级搜索?

通过高级搜索,你可以使用结构化查询语言搜索JIRA的问题。 搜索的结果会显示在 问题导航器中, 然后你可以将搜索结果输出为 MS Excel格式 以及 其他格式。 你还可以 保存 以及 订阅搜索结果。

查询语句由一个 字段, 运算符, 和 或 _函数_构成。 例如, 下面的查询语句将返回 "TEST"项目的所有问题:

project = "TEST"

(这个例子使用了 项目(project) 字段, 等于 符号, 和 "TEST"。)

注意不能比较两个 字段

当你执行高级搜索时, 你使用的是JIRA查询语言(JQL)。 JQL类似SQL表达式, 比如 #>#NULL。 当然, 你不能使用数据库查询语言; 例如, JQL不能使用 SELECT 表达式。

如何使用高级搜索

  1. 点击顶部导航菜单栏的'问题'标签链接。会显示 搜索页面。
  2. 点击 "高级"搜索模式链接。会显示 "查询" 框:
  3. 使用下面描述的 字段, 运算符 和值或函数,书写查询语句。
  4. 点击"搜索" 按钮执行查询语句。


关键字

与 AND

用于整合多个查询条件, 允许你精炼查询条件。

注意,你可以使用 括号 来控制查询条件的执行顺序。

示例
  • 查询"New office"项目中所有开放的问题:
    project = "New office" and status = "open"
  • 查询所有分配给jsmith的紧急的开放问题:
    status = open and priority = urgent and assignee = jsmith
  • 查询JRA项目中没有分配给jsmith的问题:
    project = JRA and assignee != jsmith
  • 查找JRA和CONF项目中修复版本是3.14的问题:
    project in (JRA,CONF) and fixVersion = "3.14"
  • 查找不是Jack,Jill,John报告的并且他们也不是经办人的问题:
    reporter not in (Jack,Jill,John) and assignee not in (Jack,Jill,John)

或 OR

用户整合多个查询条件, 允许你扩展查询条件。

注意,你可以使用 括号 来控制查询条件的执行顺序。

(注意: 也可以查看 在...之中(IN)章节, 使用更方便的方法搜索多个字段的值。)

示例
  • 搜索报告人是jsmith或jbrown的问题:
    reporter = jsmith or reporter = jbrown
  • 搜索已近逾期或没有设置到期日的问题:
    duedate < now() or duedate is empty

非 NOT

用于否定一个运算符或整个查询条件, 允许你优化查询条件。

注意,你可以使用 括号 来控制查询条件的执行顺序。

(注意: 也可以查看 不等于 ("!="), 不包括 ("!~"), 不再...之中不是章节)

示例
  • 搜索经办人不是jsmith的所有问题:
    not assignee = jsmith
  • 搜索所有报告人不是jsmith或不是jbrown的问题:
    not (reporter = jsmith or reporter = jbrown)

空 EMPTY

用于搜索没有值的字段。 也可以查看空(NULL)

注意 EMPTY 只能与 是(IS)不是(IS NOT) 运算符结合使用。 要查看字段支持的运算符, 点击 #字段

示例

空 NULL

用于搜索字段没有赋值的问题。 请查看 空(EMPTY)

注意 NULL 只能用于支持 是(IS)不是(IS NOT) 操作符的字段。 要了解字段支持哪些操作符, 请查看每个 字段 参考。

示例
  • 查找所有没有设置 到期日(DueDate)的问题:
    duedate = null
    duedate is null

排序 ORDER BY

用于对输出的结果,按照指定的字段排序。

默认情况下, 按照字段输出顺序排序。 你可以指定按照升序 ("asc") 或降序 ("desc")排列。

示例


运算符参考


等于: =

"=" 运算符用于查找精确匹配字段值的问题。 (注意: 不能用于 文本 字段; 文本字段的匹配条件请使用 包含 运算符。)

要精确匹配多个字段值,请使用与(AND)将多个 "=" 表达式连接起来。

示例
  • 查找由jsmith创建的所有问题:
    reporter = jsmith
  • 查找由John Smith创建的所有问题:
    reporter = "John Smith"

不等于: !=

"!=" 运算符用于查找不等于指定字段值之外的问题。 (注意: 不能用于 文本 字段; 文本字段的否定条件请使用 不包含 ("!~") 运算符。)

注意输入 field != value 与输入 NOT field = value}}具有同等效果, 并且 {{field != EMPTY 与 {{field #IS_NOT EMPTY}}也具有同等效果。

示例
  • 查找所有已经被分配经办人,但是经办人不是jsmith的问题:
    not assignee = jsmith
    or:
    assignee != jsmith
  • 查找报告人不是jsmith的所有问题:
    reporter !=jsmith
  • 查找你报告的,但经办人没有被分配给你的问题:
    reporter = currentUser() and assignee != currentUser()
  • 查找已经被分配经办人,但报告人或经办人不是John Smith的问题:
    assignee != "John Smith" or reporter != "John Smith"
  • 查找所有还没有分配经办人的问题:
    assignee is not empty
    assignee != null


大于: >

">" 运算符用于差咋后比指定字段值大的问题。 不能用于 文本 字段。

注意 ">" 运算符只能用于支持排序的字段 (例如 日期字段和版本字段等)。 要了解字段支持哪些运算符, 请查看每个 字段 参考。

示例
  • 查找所有投票数大于4的问题:
    votes > 4
  • 查找所有逾期未解决的问题:
    duedate < now() and resolution is empty
  • 查找所有优先级高于 "Normal"的问题:
    priority > normal


大于等于: >=

">=" 运算符用于查找大于等于指定字段值的问题。不能用于 文本 字段。

注意 ">=" 运算符只能用于支持排序的字段 (例如 日期字段和版本字段等)。 要了解字段支持哪些运算符, 请查看每个 字段 参考。

示例
  • 查找所有投票数大于等于 4 的问题:
    votes >= 4
  • 查找到期日大于等于 31/12/2008 的问题:
    duedate >= "2008/12/31"
  • 查找过去5天内创建的问题:
    created >= "-5d"


小于: <

The "<" 运算符用于搜索小于指定字段值的问题。 不能用于 文本 字段。

注意"<" 运算符只能用于支持排序的字段 (例如 日期字段和版本字段等)。 要了解字段支持哪些运算符, 请查看每个 字段 参考。

示例
  • 查找所有投票数小于 4 的问题:
    votes < 4


小于等于: <=

The "<=" 运算符用于搜索小于等于指定字段值的问题。 不能用于 文本 字段。

注意 "<=" 运算符只能用于支持排序的字段 (例如 日期字段和版本字段等)。 要了解字段支持哪些运算符, 请查看每个 字段 参考。

示例
  • 查找所有投票数小于等于 4的问题:
    votes <= 4
  • 查找过去一个月(30天)内没有更新的问题:
    updated <= "-4w 2d"

在...之内 IN

"IN" 运算符用于查找多个指定字段值的问题。 多个值之间用逗号分隔, 用括号括起来。

使用 "IN" 运算符相当于多个 #EQUALS (=) 表达式, 但是使用起来更方便,更简短。 也就是说, 输入 reporter IN (tom, jane, harry) 与输入 {{reporter = "tom" #OR reporter = "jane" #OR reporter = "harry"}}具有同等效果。

示例
  • 查找报告人是jsmith或jbrown或jjones的所有问题:
    reporter in (jsmith,jbrown,jjones)
  • 查找所有报告人或经办人是Jack或Jill的所有问题:
    reporter in (Jack,Jill) or assignee in (Jack,Jill)
  • 查找影响版本是3.14 或 4.2的问题:
    affectedVersion in ("3.14", "4.2")

不在...之内 NOT IN

"NOT IN" 运算符用于排除多个指定字段值的问题。

使用 "NOT IN" 运算符相当于多个 #NOT_EQUALS (!=) 表达式, 但是使用起来更方便,更简短。也就是说,输入 reporter NOT IN (tom, jane, harry) 与输入 {{reporter != "tom" #AND reporter != "jane" #AND reporter != "harry"}}具有相同的效果。

示例
  • 查找所有报告人不是Jack或不是Jill或不是John的问题:
    reporter not in (Jack,Jill,John)
  • 查找修复版本不是 'A', 'B', 'C' 或不是 'D'的问题:
    FixVersion not in ( A, B, C, D)
  • 查找修复版本不是'A', 'B', 'C' 或不是 'D'的问题, 或者没有指定修复版本值的问题:
    FixVersion not in ( A, B, C, D) or FixVersion is empty


包含: ~

"~" 运算符用于匹配指定字段值的问题 (也可以使用精确匹配或 "模糊" 匹配 — 查看下面的示例)。 只能用于文本字段, 例如:

不能呈现 {include} 包含的页面未找到。

注意: 使用 "~" 运算符, 在运算符右侧的字段值可以使用 JIRA 文本搜索语法

示例
  • 查找主题中包括"full screen"词组的问题:
    summary ~ "\"full screen\""
  • 查找主题中包括 "win"单词 (或其衍生单词, 比如 "windows" 或 "winning")的问题:
    summary ~ win

不包括: !~

"!~" 运算符用于模糊匹配不包含指定字符的问题。 只能用于文本字段, 例如:

不能呈现 {include} 包含的页面未找到。

注意: 使用 "!~" 运算符, 在运算符右侧的字段值可以使用 JIRA 文本搜索语法

示例
  • 查找主题中不包括 "run"单词的问题 (或其衍生单词, 比如 "running" 或 "ran"):
    summary !~ run

是 IS

"IS" 运算符只能与 空(EMPTY)空(NULL)结合使用。 也就是说搜索指定字段没有赋值的问题。

注意不是所有的 字段 都可以使用这个运算符; 分别查看所有的 字段 参考了解具体用法。

示例
  • 查找修复版本没有赋值的所有问题:
    fixVersion is empty
    or
    fixVersion is null

不是 IS NOT

"IS NOT" 运算符只能与 空(EMPTY)空(NULL)结合使用。也就是说搜索指定字段已经被赋值的问题。

注意不是所有的 字段 都可以使用这个运算符; 分别查看所有的 字段 参考了解具体用法。

示例
  • 查找所有被投票的问题:
    votes is not empty
    votes is not null


字段参考


影响版本

搜索指定影响版本的问题。 你可以按照版本名称或版本ID(JIRA自动为版本分配的数值)搜索 。

按照版本ID搜索比按照版本名称搜索更准确

不同的项目可能有相同名称的版本, 所有按照版本名称搜索可能会搜索到多个项目的问题。 当JIRA管理员更改版本的名称, 会使依赖版本名称的 过滤器 失效。 Version ID是唯一且无法修改的。

注意: 这个字段支持 自动完成

语法
affectedVersion
字段类型

VERSION

支持的操作符
不能呈现 {include} 包含的页面未找到。

注意比较运算符 (如 ">") 使用 版本排序(链接到Atlassian网站) 只按照JIRA管理员设置的顺序, 而不按照数值或字母顺序。

支持的函数

当使用 在...之内(IN)不在...之内(NOT IN) 运算符时, affectedVersion 支持:

示例
  • 查找影响版本是 3.14的问题:
    affectedVersion = "3.14"
    (注意点(.)是保留 #字符, 所以你需要用引号括起来。)
  • 查找影响版本是"Big Ted"的问题:
    affectedVersion = "Big Ted"
  • 查找影响版本ID是 10350的问题:
    affectedVersion = 10350

经办人

搜索经办人是指定用户的问题。 你可以使用用户全名、ID或电子邮件地址。

注意: 这个字段支持 自动完成

语法
assignee
字段类型

USER

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

当使用 #IN#NOT_IN 运算符时, assignee 支持:

When used with the #EQUALS and #NOT_EQUALS operators, assignee supports:

示例
  • Search for issues that are assigned to John Smith:
    assignee = "John Smith"
    or
    assignee = jsmith
  • Search for issues that are assigned by the user with email address "bob@mycompany.com":
    assignee = "bob@mycompany.com"
    (Note that full-stops and "@" symbols are reserved #characters, so the email address needs to be surrounded by quote-marks.)

Category

Search for issues that belong to projects in a particular Category.

Note: this field supports #auto-complete.

语法
category
字段类型

CATEGORY

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues that belong to projects in the "Alphabet Projects" Category:
     category = "Alphabet Projects"


Comment

Search for issues that have a Comment which contains particular text.

JIRA text-search syntax can be used.

Note: this field does not support #auto-complete.

语法
comment
字段类型

TEXT

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues where a Comment contains text that matches "My PC is quite old" (i.e. a "fuzzy" match:
    comment ~ "My PC is quite old"
  • Find issues where a Comment contains the exact phrase "My PC is quite old":
    comment ~ "\"My PC is quite old\""

Component

Search for issues that belong to a particular component(s) of a project. You can search by component name or component ID (i.e. the number that JIRA automatically allocates to a component).

It is safer to search by component ID than by component name

Different projects may have components with the same name, so searching by component name may return issues from multiple projects. It is also possible for your JIRA administrator to change the name of a component, which could break any saved filters which rely on that name. Component IDs, however, are unique and cannot be changed.

注意: 这个字段支持自动完成

语法
component
字段类型

COMPONENT

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #IN and #NOT_IN operators, component supports:

示例
  • Find issues in the "Comp1" or "Comp2" component:
     component in (Comp1, Comp2)
  • Find issues in the "Comp1" and "Comp2" components:
     component in (Comp1) and component in (Comp2)
    or
     component = Comp1 and component = Comp2
  • Find issues in the component with ID 20500:
    component = 20500



Created

Search for issues that were created on, before or after a particular date (or date range).

不能呈现 {include} 包含的页面未找到。

Note: this field does not support #auto-complete.

语法
created

Alias:

createdDate
字段类型

DATE

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #EQUALS, #NOT_EQUALS, #GREATER_THAN, #GREATER_THAN_EQUALS, #LESS_THAN or #LESS_THAN_EQUALS operators, createdDate supports:

示例
  • Find all issues created on or before 12th December 2008 00:00:
    created <= "2008/12/12"
  • Find issues created less than one day ago:
    created > "-1d"
  • Find issues created in January 2009:
    created > "2008/12/31" and created < "2009/02/01"
  • Find issues created on 15 January 2009:
    created > "2009/01/14" and created < "2009/01/16"

Custom Field

Only applicable if your JIRA administrator has created one or more Custom Fields.

Search for issues where a particular Custom Field has a particular value.

You can search by Custom Field name or Custom Field ID (i.e. the number that JIRA automatically allocates to an Custom Field).

It is safer to search by Custom Field ID than by Custom Field name

It is possible for a Custom Field to have the same name as a built-in JIRA system field, in which case JIRA will search on the system field (not your custom field). It is also possible for your JIRA administrator to change the name of a Custom Field, which could break any saved filters which rely on that name. Custom Field IDs, however, are unique and cannot be changed.

Note:

  • JIRA text-search syntax can be used with Custom Fields of type 'Text'.
  • #auto-complete is supported for Custom Fields of type picker, group picker, select (except 'Cascading Select'), check-box and radio button fields.
语法
CustomFieldName

Alias:

cf[CustomFieldID]
字段类型

Depends on the Custom Field's configuration

支持的运算符

Different types of Custom Fields support different #operators. For the default Custom Field Types, the following operators are supported:

  • Number and date/time fields:
    不能呈现 {include} 包含的页面未找到。
  • Picker, select, check-box and radio button fields:
    不能呈现 {include} 包含的页面未找到。
  • Text fields:
    不能呈现 {include} 包含的页面未找到。
支持的函数

Different types of Custom Fields support different #functions. For the default Custom Field Types, the following functions are supported:

示例
  • Find issues where the value of the "Location" Custom Field is "New York":
    location = "New York"
  • Find issues where the value of the Custom Field with ID 10003 is "New York":
    cf[10003] = "New York"
  • Find issues where the value of the "Location" Custom Field is "London" or "Milan" or "Paris":
    cf[10003] in ("London", "Milan", "Paris")
  • Find issues where the "Location" Custom Field has no value:
    location != empty

Description

Search for issues where the Description contains particular text.

JIRA text-search syntax can be used.

Note: this field does not support #auto-complete.

语法
description
字段类型

TEXT

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues where the Description contains text that matches "Please see screenshot" (i.e. a "fuzzy" match):
    description ~ "Please see screenshot"
  • Find issues where the Description contains the exact phrase "Please see screenshot":
    description ~ "\"Please see screenshot\""



Due

Search for issues that were due on, before or after a particular date (or date range).

不能呈现 {include} 包含的页面未找到。

Note that Due Date relates to the date only (not to the time).

Note: this field does not support #auto-complete.

语法
due

Alias:

dueDate
字段类型

DATE

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #EQUALS, #NOT_EQUALS, #GREATER_THAN, #GREATER_THAN_EQUALS, #LESS_THAN or #LESS_THAN_EQUALS operators, dueDate supports:

示例
  • Find all issues due on or before 31st December 2008:
    due <= "2008/12/31"
  • Find issues that are due tomorrow:
    due = "1d"
  • Find issues that were due in January 2009:
    due > "2008/12/31" and due < "2009/02/01"
  • Find issues that were due on 15 January 2009:
    due > "2009/01/14" and due < "2009/01/16"

Environment

Search for issues where the Environment contains particular text.

JIRA text-search syntax can be used.

Note: this field does not support #auto-complete.

语法
environment
字段类型

TEXT

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues where the Environment contains text that matches "Third floor" (i.e. a "fuzzy" match):
    environment ~ "Third floor"
  • Find issues where the Environment contains the exact phrase "Third floor":
    environment ~ "\"Third floor\""

Filter

You can use a saved filter to narrow your search. You can search by filter name or filter ID (i.e. the number that JIRA automatically allocates to a saved filter).

It is safer to search by filter ID than by filter name

It is possible for a filter name to be changed, which could break a saved filter that invokes another filter by name. Filter IDs, however, are unique and cannot be changed.

Note:

  • An #ORDER BY statement in your typed query will override an ORDER BY statement in the saved filter.
  • You cannot run or save a filter that would cause an infinite loop (i.e. you cannot reference a saved filter if it eventually references your current filter).
  • This field supports #auto-complete.
    语法
    filter
    Aliases:
    request
    savedFilter
    searchRequest
字段类型

FILTER

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Search the results of the filter "My Saved Filter" (which has an ID of 12000) for issues assigned to the user jsmith:
    filter = "My Saved Filter" and assignee = jsmith
    or
    filter = 12000 and assignee = jsmith


Fix Version

Search for issues that are assigned to a particular Fix Version. You can search by version name or version ID (i.e. the number that JIRA automatically allocates to a version).

It is safer to search by version ID than by version name

Different projects may have versions with the same name, so searching by version name may return issues from multiple projects. It is also possible for your JIRA administrator to change the name of a version, which could break any saved filters that rely on that name. Version IDs, however, are unique and cannot be changed.

注意: 这个字段支持自动完成

语法
fixVersion
字段类型

VERSION

支持的运算符
不能呈现 {include} 包含的页面未找到。

Note that the comparison operators (e.g. ">") use the version order that has been set up by your project administrator, not a numeric or alphabetic order.

支持的函数

When used with the #IN and #NOT_IN operators, fixVersion supports:

示例
  • Find issues with a Fix Version of 3.14 or 4.2:
     fixVersion in ("3.14", "4.2")
    (Note that full-stops are reserved #characters, so they need to be surrounded by quote marks.)
  • Find issues with a Fix Version of "Little Ted":
    fixVersion = "Little Ted"
  • Find issues with a Fix Version ID of 10001:
    fixVersion = 10001

Issue Key

Search for issues with a particular Issue Key or Issue ID (i.e. the number that JIRA automatically allocates to an Issue).

Note: this field does not support #auto-complete.

语法
issueKey

Aliases:

id
issue
key
字段类型

ISSUE

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #IN or #NOT_IN operators, issueKey supports:

示例
  • Find the issue with key "ABC-123":
    issueKey = ABC-123 

Level

Only available if Issue Level Security has been enabled by your JIRA administrator.

Search for issues with a particular Security Level. You can search by Issue Security Level name or Issue Security Level ID (i.e. the number that JIRA automatically allocates to an Issue Security Level).

It is safer to search by Security Level ID than by Security Level name

It is possible for your JIRA administrator to change the name of a Security Level, which could break any saved filter which rely on that name. Security Level IDs, however, are unique and cannot be changed.

注意: 这个字段支持自动完成

语法
level
字段类型

SECURITY LEVEL

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Search for issues with a Security Level of "Really High" or "level1":
    level in ("Really High", level1)
  • Search for issues with a Security Level ID of 123:
    level = 123


Original Estimate

Only available if time-tracking has been enabled by your JIRA administrator.

Search for issues where the Original Estimate is set to a particular value (i.e. a number, not a date or date range).

Use "w", "d", "h" and "m" to specify weeks, days, hours or minutes.

Note: this field does not support #auto-complete.

语法
originalEstimate

Alias:

timeOriginalEstimate
字段类型

DURATION

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues with an Original Estimate of 1 hour:
    originalEstimate = 1h
  • Find issues with an Original Estimate of more than 2 days:
    originalEstimate > 2d

Parent

Only available if sub-tasks have been enabled by your JIRA administrator.

Search for all sub-tasks of a particular issue. You can search by Issue Key or by Issue ID (i.e. the number that JIRA automatically allocates to an Issue).

Note: this field does not support #auto-complete.

语法
parent
字段类型

ISSUE

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues that are sub-tasks of issue TEST-1234:
    parent = TEST-1234

Priority

Search for issues with a particular Priority. You can search by Priority name or Priority ID (i.e. the number that JIRA automatically allocates to a Priority).

It is safer to search by Priorty ID than by Priority name

It is possible for your JIRA administrator to change the name of a Priority, which could break any saved filter which rely on that name. Priority IDs, however, are unique and cannot be changed.

注意: 这个字段支持自动完成

语法
priority
字段类型

PRIORITY

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues with a Priority of "High":
     priority = High
  • Find issues with a Priority ID of 10000:
    priority = 10000

Project

Search for issues that belong to a particular Project

You can search by Project Name, by Project Key or by Project ID (i.e. the number that JIRA automatically allocates to a project).

注意: 这个字段支持自动完成

语法
project
字段类型

PROJECT

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #IN and #NOT_IN operators, project supports:

示例
  • Find issues that belong to the Project that has the name "ABC Project":
     project = "ABC Project" 
  • Find issues that belong to the Project that has the key "ABC":
    project = "ABC"
  • Find issues that belong to the Project that has the ID "1234":
    project = 1234


Remaining Estimate

Only available if time-tracking has been enabled by your JIRA administrator.

Search for issues where the Remaining Estimate is set to a particular value (i.e. a number, not a date or date range).

Use "w", "d", "h" and "m" to specify weeks, days, hours or minutes.

Note: this field does not support #auto-complete.

语法
remainingEstimate

Alias:

timeEstimate
字段类型

DURATION

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues with a Remaining Estimate of more than 4 hours:
     remainingEstimate > 4h 

Reporter

Search for issues that were reported by (i.e. created by) a particular user.

You can search by the user's Full Name, ID or Email Address.

注意: 这个字段支持自动完成

语法
reporter
字段类型

USER

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #IN and #NOT_IN operators, reporter supports:

When used with the #EQUALS and #NOT_EQUALS operators, reporter supports:

示例
  • Search for issues that were created by Jill Jones:
    reporter = "Jill Jones"
    or
    reporter = jjones
  • Search for issues that were created by the user with email address "bob@mycompany.com":
    assignee = "bob@mycompany.com"
    (Note that full-stops and "@" symbols are reserved #characters, so the email address needs to be surrounded by quote-marks.)

Resolution

Search for issues that have a particular Resolution

You can search by Resolution name or Resolution ID (i.e. the number that JIRA automatically allocates to a Resolution).

It is safer to search by Resolution ID than Resolution name

It is possible for your JIRA administrator to change the name of a Resolution, which could break any saved filter which rely on that name. Resolution IDs, however, are unique and cannot be changed.

注意: 这个字段支持自动完成

语法
resolution
字段类型

RESOLUTION

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues with a Resolution of "Cannot Reproduce" or "Won't Fix":
     resolution in ("Cannot Reproduce", "Won't Fix")
  • Find issues with a Resolution ID of 5:
    resolution = 5
  • Find issues that do not have a Resolution:
    resolution = unresolved



Resolved

Search for issues that were resolved on, before or after a particular date (or date range).

不能呈现 {include} 包含的页面未找到。

Note: this field does not support #auto-complete.

语法
resolved

Alias:

resolutionDate
字段类型

DATE

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #EQUALS, #NOT_EQUALS, #GREATER_THAN, #GREATER_THAN_EQUALS, #LESS_THAN or #LESS_THAN_EQUALS operators, resolved supports:

示例
  • Find all issues that were resolved on or before 31st December 2008 00:00:
    resolved <= "2008/12/31"
  • Find issues that were resolved in January 2009:
    resolved > "2008/12/31" and resolved < "2009/02/01"
  • Find issues that were resolved on 15 January 2009:
    resolved > "2009/01/14" and resolved < "2009/01/16"
  • Find issues that were resolved in the last hour:
    resolved > -1h

Status

Search for issues that have a particular Status.

You can search by Status name or Status ID (i.e. the number that JIRA automatically allocates to a Status).

It is safer to search by Status ID than Status name

It is possible for your JIRA administrator to change the name of a Status which could break any saved filter which rely on that name. Status IDs, however, are unique and cannot be changed.

注意: 这个字段支持自动完成

语法
status
字段类型

STATUS

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues with a Status of "Open":
     status = Open
  • Find issues with a Status ID of 1:
    status = 1

Summary

Search for issues where the Summary contains particular text.

JIRA text-search syntax can be used.

Note: this field does not support #auto-complete.

语法
summary
字段类型

TEXT

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues where the Summary contains text that matches "Error saving file" (i.e. a "fuzzy" match):
    summary ~ "Error saving file"
  • Find issues where the Summary contains the exact phrase "Error saving file":
    summary ~ "\"Error saving file\""


Text

This is a "master-field" that allows you to search all text fields, i.e.:

不能呈现 {include} 包含的页面未找到。

Note: The text master-field can only be used with the #CONTAINS operator ("~" and "!~").

语法
text
字段类型

TEXT

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues where a text field matches the word "Fred":
    text ~ "Fred"
    or
    text ~ Fred
  • Find all issues where a text field contains the exact phrase "full screen":
    text ~ "\"full screen\""

Type

Search for issues that have a particular Issue Type.

You can search by Issue Type name or Issue Type ID (i.e. the number that JIRA automatically allocates to an Issue Type).

It is safer to search by Type ID than Type name

It is possible for your JIRA administrator to change the name of a Type, which could break any saved filter which rely on that name. Type IDs, however, are unique and cannot be changed.

注意: 这个字段支持自动完成

语法
type

Alias:

issueType
字段类型

ISSUE_TYPE

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues with an Issue Type of "Bug":
    type = Bug
  • Find issues with an Issue Type of "Bug" or "Improvement":
     issueType in (Bug,Improvement)
  • Find issues with an Issue Type ID of 2:
    issueType = 2


Time Spent

Only available if time-tracking has been enabled by your JIRA administrator.

Search for issues where the Time Spent is set to a particular value (i.e. a number, not a date or date range).

Use "w", "d", "h" and "m" to specify weeks, days, hours or minutes.

Note: this field does not support #auto-complete.

语法
timeSpent
字段类型

DURATION

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues where the Time Spent is more than 5 days:
    timeSpent > 5d



Updated

Search for issues that were last updated on, before or after a particular date (or date range).

不能呈现 {include} 包含的页面未找到。

Note: this field does not support #auto-complete.

语法
updated

Alias:

updatedDate
字段类型

DATE

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #EQUALS, #NOT_EQUALS, #GREATER_THAN, #GREATER_THAN_EQUALS, #LESS_THAN or #LESS_THAN_EQUALS operators, updated supports:

示例
  • Find issues that were updated on or before 12th December 2008 00:00:
    updated <= "2008/12/12"
  • Find issues that were updated more than two weeks ago:
    updated < "-2w"
  • Find issues that were updated on 15 January 2009:
    updated > "2009/01/14" and updated < "2009/01/16"
  • Find issues that were updated in January 2009:
    updated > "2008/12/31" and updated < "2009/02/01"


Voter

Search for issues for which a particular user has voted. You can search by the user's Full Name, ID or Email Address. Note that you can only find issues for which you have the "View Voters and Watchers" permission, unless you are searching for your own votes. See also #votedIssues.

注意: 这个字段支持自动完成

语法
voter
字段类型

USER

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #IN and #NOT_IN operators, voter supports:

When used with the #EQUALS and #NOT_EQUALS operators, voter supports:

示例
  • Search for issues for which you have voted:
    voter = currentUser()
  • Search for issues for which the user "jsmith" has voted:
    voter = "jsmith"
  • Search for issues for which a member of the group "jira-developers" has voted:
    voter in membersOf("jira-developers")

Votes

Search for issues with a specified number of votes.

Note: this field does not support #auto-complete.

语法
votes
字段类型

NUMBER

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find all issues that have 12 or more votes:
    votes >= 12


Watcher

Search for issues that a particular user is watching. You can search by the user's Full Name, ID or Email Address. Note that you can only find issues for which you have the "View Voters and Watchers" permission, unless you are searching for issues where you are the watcher. See also #watchedIssues.

注意: 这个字段支持自动完成

语法
voter
字段类型

USER

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

When used with the #IN and #NOT_IN operators, watcher supports:

When used with the #EQUALS and #NOT_EQUALS operators, watcher supports:

示例
  • Search for issues that you are watching:
    watcher = currentUser()
  • Search for issues that the user "jsmith" is watching:
    watcher = "jsmith"
  • Search for issues that are being watched by a member of the group "jira-developers":
    watcher in membersOf("jira-developers")


Work Ratio

Only available if time-tracking has been enabled by your JIRA administrator.

Search for issues where the Work Ratio has a particular value.

Work Ratio is calculated as follows: workRatio = #timeSpent / #originalEstimate) x 100

Note: this field does not support #auto-complete.

语法
workRatio
字段类型

NUMBER

支持的运算符
不能呈现 {include} 包含的页面未找到。
支持的函数

n/a

示例
  • Find issues on which more than 75% of the Original Estimate has been spent:
     workRatio > 75


Functions Reference

cascadeOption()

Search for issues that match the selected values of a 'cascading select' custom field.

The parentOption parameter matches against the first tier of options in the cascading select field. The childOption parameter matches against the second tier of options in the cascading select field, and is optional.

The keyword "none" can be used to search for issues where either or both of the options have no value.

语法
cascadeOption(parentOption)

or

cascadeOption(parentOption,childOption)
Supported Field Types

CASCADING_OPTION

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues where a custom field ("Location") has the value "USA" for the first tier and "New York" for the second tier:
    location in cascadeOption("USA","New York")
  • Find issues where a custom field ("Location") has the value "USA" for the first tier and any value (or no value) for the second tier:
    location in cascadeOption("USA")
  • Find issues where a custom field ("Location") has the value "USA" for the first tier and no value for the second tier:
    location in cascadeOption("USA",none)
  • Find issues where a custom field ("Location") has no value for the first tier and no value for the second tier:
    location in cascadeOption(none)
  • Find issues where a custom field ("Referrer") has the value "none" for the first tier and "none" for the second tier:
    referrer in cascadeOption("\"none\"","\"none\"")
  • Find issues where a custom field ("Referrer") has the value "none" for the first tier and no value for the second tier:
    referrer in cascadeOption("\"none\"",none)

componentsLeadByUser()

Find issues in components that are lead by a specific user.

You can optionally specify a user, or if the user is omitted the current user (i.e. you) will be used.

Note that if you are not logged in to JIRA, a user must be specified.

语法
componentsLeadByUser()

or

componentsLeadByUser(username)
Supported Field Types

COMPONENT

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find open issues in components that are lead by you:
    component in componentsLeadByUser() AND status = Open
  • Find open issues in components that are lead by Bill:
    component in componentsLeadByUser(bill) AND status = Open

currentLogin()

Perform searches based on the time at which the current user's session began. See also #lastLogin.

语法
currentLogin()
Supported Field Types

DATE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that have been created during my current session:
    created > currentLogin()

currentUser()

Perform searches based on the currently logged-in user.

Note that this function can only be used by logged-in users. So if you are creating a saved filter that you expect to be used by anonymous users, do not use this function.

语法
currentUser()
Supported Field Types

USER

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that are assigned to me:
    assignee = currentUser()
  • Find issues that were reported to me but are not assigned to me:
    reporter = currentUser() and assignee != currentUser()

issueHistory()

Find issues that you have recently viewed, i.e. issues that are in the 'Recent Issues' section of the 'Issues' drop-down menu.

Note:

  • issueHistory() returns up to 50 issues, whereas the 'Recent Issues' drop-down returns only 5.
  • if you are not logged in to JIRA, only issues from your current browser session will be included.
语法
issueHistory()
Supported Field Types

ISSUE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues which I have recently viewed, that are assigned to me:
    issue in issueHistory() AND assignee = currentUser()

lastLogin()

Perform searches based on the time at which the current user's previous session began. See also #currentLogin.

语法
currentLogin()
Supported Field Types

DATE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that have been created during my last session:
    created > lastLogin()

linkedIssues()

Perform searches based on issues which are linked to a specified issue.

You can optionally restrict the search to links of a particular type. Note that LinkType is case-sensitive.

语法
linkedIssues(issueKey)

or

linkedIssues(issueKey,linkType)
Supported Field Types

ISSUE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that are linked to a particular issue:
    issue in linkedIssues(ABC-123)
  • Find issues that are linked to a particular issue via a particular type of link:
    issue in linkedIssues(ABC-123,"is duplicated by")

membersOf()

Perform searches based on the members of a particular group.

语法
membersOf(Group)
Supported Field Types

USER

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues where the Assignee is a member of the group "jira-developers":
    assignee in membersOf("jira-developers")
  • Search through multiple groups and a specific user, e.g:
    reporter in membersOf("jira-developers") or reporter in membersOf("jira-administrators") or reporter=jsmith
  • Search for a particular group, but exclude a particular member or members, e.g.:
    assignee in membersOf(QA) and assignee not in ("John Smith","Jill Jones")
  • Exclude members of a particular group:
    assignee not in membersOf(QA)

now()

Perform searches based on the current time.

语法
now()
Supported Field Types

DATE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that are overdue:
    duedate < now() and status not in (closed, resolved) 

projectsLeadByUser()

Find issues in projects that are lead by a specific user.

You can optionally specify a user, or if the user is omitted the current user will be used.

Note that if you are not logged in to JIRA, a user must be specified.

语法
projectsLeadByUser()

or

projectsLeadByUser(username)
Supported Field Types

PROJECT

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find open issues in projects that are lead by you:
    project in projectsLeadByUser() AND status = Open
  • Find open issues in projects that are lead by Bill:
    project in projectsLeadByUser(bill) AND status = Open

projectsWhereUserHasPermission()

Find issues in projects where you have a specific permission.

Note that this function is only available if you are logged in to JIRA.

语法
projectsWhereUserHasPermission(permission)

For the permission parameter you can specify any of the following:

不能呈现 {include} 包含的页面未找到。
Supported Field Types

PROJECT

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find open issues in projects where you have the "Resolve Issues" permission:
    project in projectsWhereUserHasPermission("Resolve Issues") AND status = Open

projectsWhereUserHasRole()

Find issues in projects where you have a specific role.

Note that this function is only available if you are logged in to JIRA.

语法
projectsWhereUserHasRole(rolename)
Supported Field Types

PROJECT

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find open issues in projects where you have the "Developers" role:
    project in projectsWhereUserHasRole("Developers") AND status = Open

releasedVersions()

Perform searches based on the released versions (i.e. versions that your JIRA administrator has released) of a specified project.

You can also search on the released versions of all projects, by omitting the project parameter.

语法
releasedVersions()

or

releasedVersions(project)
Supported Field Types

VERSION

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues whose #FixVersion is a released version of the ABC project:
    fixVersion in releasedVersions(ABC)
  • Find issues that relate to released versions of the ABC project:
    affectedVersion in releasedVersions(ABC)
    or
    fixVersion in releasedVersions(ABC)

standardIssueTypes()

Perform searches based on "standard" Issue Types, that is, search for issues which are not sub-tasks.

语法
standardIssueTypes()
Supported Field Types

ISSUE_TYPE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that are not subtasks (i.e. issues whose Issue Type is a standard issue type, not a subtask issue type):
    issuetype in standardIssueTypes()

subtaskIssueTypes()

Perform searches based on issues which are sub-tasks.

语法
subtaskIssueTypes()
Supported Field Types

ISSUE_TYPE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that are subtasks (i.e. issues whose Issue Type is a subtask issue type):
    issuetype in subtaskIssueTypes()

unreleasedVersions()

Perform searches based on the unreleased versions (i.e. versions that your JIRA administrator has not yet released) of a specified project.

You can also search on the unreleased versions of all projects, by omitting the project parameter.

语法
unreleasedVersions()

or

unreleasedVersions(project)
Supported Field Types

VERSION

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues whose #FixVersion is an unreleased version of the ABC project:
    fixVersion in unreleasedVersions(ABC)
  • Find issues that relate to unreleased versions of the ABC project:
    affectedVersion in unreleasedVersions(ABC)
    or
    fixVersion in unreleasedVersions(ABC)

votedIssues()

Perform searches based on issues for which you have voted. Also see the #Voter field.

Note that this function can only be used by logged-in users.

语法
votedIssues()
Supported Field Types

ISSUE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that you have voted for:
    issue in votedIssues()

watchedIssues()

Perform searches based on issues which you are watching. Also see the #Watcher field.

Note that this function can only be used by logged-in users.

语法
watchedIssues()
Supported Field Types

ISSUE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that you are watching:
    issue in watchedIssues()
Supported Field Types

ISSUE

支持的运算符
不能呈现 {include} 包含的页面未找到。
示例
  • Find issues that you have recently viewed:
    issue in issueHistory()

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.

Performing Text Searches

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

For details, please see the page on Performing Text Searches, which includes the following sections:

呈现宏 'excerpt-include' 时发生错误

No link could be created for 'quickstart: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.

If you type a space at the start of your query...

...JIRA will offer a list of all available fields, e.g.:

If you type one or more characters...

...JIRA will offer a list of matching fields, e.g.:

If you type a field then a space...

...JIRA will offer a list of valid #operators, e.g.:

If you type a field, then an operator, then a space...

...JIRA will offer a list of valid values, e.g.:

If you type a field, then an operator, then one or more characters...

...JIRA will offer a list of valid values (if your #field supports this) and valid functions for the field/operator combination, e.g.:


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', particular 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'.

Reserved Characters

JQL has a list of reserved characters. These characters need to be surrounded by quote-marks if you wish to use them in queries:

  • space (" ")
  • "+"
  • "."
  • ","
  • ";"
  • "?"
  • "|"
  • "'"
  • "*"
  • "/"
  • "%"
  • "^"
  • "$"
  • "#"
  • "@"

You can use either single quote-marks (') or double quote-marks (").

If your search term contains a quote-mark, you will need to precede it with the escape character (back-slash), e.g.:

"Type your name in the \"Login\" box"

If you use a single quote to escape your search term, then you can use the double quote (without escaping it) inside the single quotes; but you will have to escape any other single quotes. And vice-versa.

Note that there is an additional list of reserved characters for Text Searches, which applies to the following fields:

不能呈现 {include} 包含的页面未找到。
.

保留字符

JQL保留一些专用的单词. 如果你需要在查询语句中使用下面的单词,必须用引号将其括起来:

"abort", "access", "add", "after", "alias", "all", "alter", "and", "any", "as", "asc",
"audit", "avg", "before", "begin", "between", "boolean", "break", "by", "byte", "catch", "cf",
"char", "character", "check", "checkpoint", "collate", "collation", "column", "commit", "connect", "continue",
"count", "create", "current", "date", "decimal", "declare", "decrement", "default", "defaults", "define", "delete",
"delimiter", "desc", "difference", "distinct", "divide", "do", "double", "drop", "else", "empty", "encoding",
"end", "equals", "escape", "exclusive", "exec", "execute", "exists", "explain", "false", "fetch", "file", "field",
"first", "float", "for", "from", "function", "go", "goto", "grant", "greater", "group", "having",
"identified", "if", "immediate", "in", "increment", "index", "initial", "inner", "inout", "input", "insert",
"int", "integer", "intersect", "intersection", "into", "is", "isempty", "isnull", "join", "last", "left",
"less", "like", "limit", "lock", "long", "max", "min", "minus", "mode", "modify",
"modulo", "more", "multiply", "next", "noaudit", "not", "notin", "nowait", "null", "number", "object",
"of", "on", "option", "or", "order", "outer", "output", "power", "previous", "prior", "privileges",
"public", "raise", "raw", "remainder", "rename", "resource", "return", "returns", "revoke", "right", "row",
"rowid", "rownum", "rows", "select", "session", "set", "share", "size", "sqrt", "start", "strict",
"string", "subtract", "sum", "synonym", "table", "then", "to", "trans", "transaction", "trigger", "true",
"uid", "union", "unique", "update", "user", "validate", "values", "view", "when", "whenever", "where",
"while", "with"

你既可以使用单引号 (') 也可以使用双引号 (").

(JIRA管理员请注意: 上面列表是 JqlStringSupportImpl.java 文件的固定编码。)

注意还有一些其他 文本搜索的保留字段, which applies to the following fields:

不能呈现 {include} 包含的页面未找到。
.

  • 无标签