Jira - ilya-khadykin/notes-outdated GitHub Wiki

Jira is a proprietary issue tracking product, developed by Atlassian. It provides bug tracking, issue tracking, and project management functions.

Advanced searching

The advanced search allows you to build structured queries using the JIRA Query Language (JQL) to search for issues.

/issues/?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:

project = "TEST"
project = "TEST" AND assignee = currentuser()

Running a saved search

Saved searches (also known as Saving your search as a filter) are shown in the left panel, when using advanced search. If the left panel is not showing, hover your mouse over the left side of the screen to display it.

To run a filter, e.g. My Open Issues, simply click it. The JQL for the advanced search will be set, and the search results will be displayed.

Search Queries

Wildcard searches with ? and *

You cannot use a * or ? symbol as the first character of a search - https://jira.atlassian.com/browse/JRA-6218

te?t
win*
wi*95

Fuzzy searches with ~

roam~

This search will find terms like foam and roams

Proximity searches

JIRA supports finding words that are within a specific distance away. To do a proximity search, use the tilde, ~, symbol at the end of a phrase. For example, to search for "atlassian" and "jira" within 10 words of each other in a document, use the search:

"atlassian jira"~10

Boosting a term with ^

"atlassian jira"^4 querying

The term "atlassian jira" will be boosted to be more relevant with the factor next to the term

By default, the boost factor is 1. Although, the boost factor must be positive, it can be less than 1 (i.e. 0.2).

Boolean operators

Boolean operators must be ALL CAPS.

OR (||) | AND (&&) | Required term: + | NOT (!) | Excluded term: -

Grouping with parenthesis

Escaping special characters with \ or \\

Reserved words

The following English reserved words (also known as 'stop words') are ignored from the search index and hence, JIRA's text search features:

"a", "and", "are", "as", "at", "be", "but", "by", "for", "if", "in", "into", "is", "it", "no", "not", "of", "on", "or", "s", "such", "t", "that", "the", "their", "then", "there", "these", "they", "this", "to", "was", "will", "with"

Word stemming

summary ~ "customize"

will retrieve issues whose Summary field contains the following words:

  • customized
  • customizing
  • customs
  • customer
  • etc.

Search Operators

EQUALS =

Cannot be used with text fields; see the CONTAINS operator instead

reporter = jsmith
reporter = "John Smith"

NOT EQUALS !=

Cannot be used with text fields; see the DOES NOT MATCH ("!~") operator instead

not assignee = jsmith
assignee != jsmith or assignee is empty
reporter = currentUser() and assignee != currentUser()
assignee != "John Smith" or reporter != "John Smith"
assignee is not empty
assignee != null

GREATER THAN > and LESS THAN <

Note that the > or < operator can only be used with fields that support ordering (e.g. date fields and version fields), and cannot be used with text fields

votes > 4
duedate < now() and resolution is empty
priority > normal

votes < 4

GREATER THAN EQUALS >= or LESS THAN EQUALS <=

Note that the >= or <= operator can only be used with fields that support ordering (e.g. date fields and version fields), and cannot be used with text fields

duedate >= "2008/12/31"
created >= "-5d"
votes <= 4
updated <= "-4w 2d"

IN or NOT IN

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".

reporter in (jsmith,jbrown,jjones)
reporter in (Jack,Jill) or assignee in (Jack,Jill)
affectedVersion in ("3.14", "4.2")

assignee not in (Jack,Jill,John)
assignee not in (Jack,Jill,John) or assignee is empty
FixVersion not in (A, B, C, D)
FixVersion not in (A, B, C, D) or FixVersion is empty

CONTAINS ~ or DOES NOT CONTAIN !~

The "~" or !~ 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.:

  • Summary
  • Description
  • Environment
  • Comments
Summary ~ "some words" OR Description ~ "some words"

summary ~ win
summary ~ "win*"
summary ~ "issue collector"
summary ~ "\"full screen\""

summary !~ run

IS or IS NOT

The "IS" or "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 no value. Note that not all fields are compatible with this operator; see the individual field reference for details.

fixVersion is empty
fixVersion is null

votes is not empty
votes is not null

WAS / WAS IN / WAS NOT IN / WAS NOT

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

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, Priority, Reporter, Resolution, and Status fields only.)
// 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")

// Find all issues that currently have, or previously had, a status of 'Resolved' or 'In Progress':
status WAS IN ("Resolved","In Progress")

// 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"

// Find issues that do not have, and have 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"

CHANGED

The "CHANGED" operator is used to find issues that have a value that 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" (Note: This operator can be used with the Assignee, Fix Version, Priority, Reporter, Resolution, and Status fields only.)
assignee CHANGED
status CHANGED FROM "In Progress" TO "Open"
priority CHANGED BY freddo BEFORE endOfWeek() AFTER startOfWeek()

Setting the precedence of operators

Use parenthesis to set a correct order of operators:

(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.

Reserved Characters and words in JQL

Reserved Characters:

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

They should be escaped:

version = "[example]"
summary ~ "\\[example\\]"

Reserved words n(this list is hard coded in the JqlStringSupportImpl.java file):

"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"

List of Fields in Jira

Affected version
Assignee
Attachments
Category
Comment
Component
Created
Creator
Custom field
Customer Request Type
Description
Due
Environment
Epic link
Filter
Fix version
Issue key
Labels
Last viewed
Level
Original estimate
Parent
Priority
Project
Remaining estimate
Reporter
Resolution
Resolved
Sprint
Status
Summary
Text
Time spent
Type
Updated
Voter
Votes
Watcher
Watchers
Work ratio

List of Operators

EQUALS: =
NOT EQUALS: !=
GREATER THAN: >
GREATER THAN EQUALS: >=
LESS THAN: <
LESS THAN EQUALS: <=
IN
NOT IN
CONTAINS: ~
DOES NOT CONTAIN: !~
IS
IS NOT
WAS
WAS IN
WAS NOT IN
WAS NOT
CHANGED

List of Keywords

AND
OR
NOT
EMPTY
NULL
ORDER BY

List of Functions

cascadeOption()
closedSprints()
componentsLeadByUser()
currentLogin()
currentUser()
earliestUnreleasedVersion()
endOfDay()
endOfMonth()
endOfWeek()
endOfYear()
issueHistory()
issuesWithRemoteLinksByGlobalId()
lastLogin()
latestReleasedVersion()
linkedIssues()
membersOf()
now()
openSprints()
projectsLeadByUser()
projectsWhereUserHasPermission()
projectsWhereUserHasRole()
releasedVersions()
standardIssueTypes()
startOfDay()
startOfMonth()
startOfWeek()
startOfYear()
subtaskIssueTypes()
unreleasedVersions()
votedIssues()
watchedIssues()

References