JQL Keywords
Custom field name duplicates
If you have custom fields with the same name as Jira default fields, Enhanced Search will prioritise Jira’s default fields during searches. We recommend renaming your custom fields before using them in search queries, as Jira’s default fields will be used instead of custom fields with the same name.
When searching in Advanced mode, the JQL Keywords described in this section can be used in the Issue Search screen. To help your understanding of JQL keywords, we've outlined each one with an explanation and example.
JQL keywords will not work until an initial metadata synchronization has been performed, as described in JQL Keyword Synchronization.
Attachments
numberOfAttachments
This keyword can be used to find issues that have a certain number of file attachments.
status = Closed AND numberOfAttachments > 3
This keyword can be used with the numeric comparison operators.
attachmentType
This keyword can be used to search for issues that have a particular file type attached to them. File types are determined by the file extension e.g. a file called screenshot.png has a file type of 'png'.
numberOfAttachments > 0 AND attachmentType = 'jpg'
issuetype = Invoice AND attachmentType in ('pdf', 'docx', 'xls')
This keyword can use the=
,!=
,in
andnot in
operators.
firstAttachmentDate
The firstAttachmentDate keyword can be used to find issues based on the date that the first attachment was added:
project = STORAGE AND firstAttachmentDate < now()
project = STORAGE AND firstAttachmentDate >= '2016-04-01'
project = STORAGE AND firstAttachmentDate = '2000-01-01'
As you can see from the first example, we can use relative date functions that come built-in to JQL. We can also use the regular numeric comparison operators.
lastAttachmentDate
The lastAttachmentDate keyword can be used to find issues based on the date that the most recent attachment was added:
project = STORAGE AND lastAttachmentDate > startOfMonth()
In the same way as firstAttachmentDate, this keyword can use the numeric comparison operators and the relative date JQL functions.
fileAttachedBy
This keyword can be used to find issues that have a file attached by a particular user. You must use the username of the user you are interested in.
reporter = currentUser() AND fileAttachedBy = "jbloggs"
This keyword can also be compared using the !=
, in
and not in
operators.
Comments
numberOfComments
The numberOfComments keyword can be used to find issues with a particular number of comments:
resolution = 'Wont Fix' AND numberOfComments > 0
This keyword can be used with the numeric comparison operators.
firstCommentedDate
The firstCommentedDate keyword can be used to search for issues based on the date of the first comment.
created > startOfDay() AND firstCommentedDate = now()
priority = High AND firstCommentedDate < startOfWeek()
This keyword can be used with the JQL relative date functions and also the numeric comparison operators.
lastCommentedDate
The lastCommentedDate keyword can be used to search for issues based on the date of most recent comment.
assignee = currentUser() AND lastCommentedDate < startOfMonth()
status = 'In Progress' AND lastCommentedDate = '2016-10-14'
This keyword can be used with the JQL relative date functions and also the numeric comparison operators.
commentedOn
This keyword can be used to find issues that had a comment made on them on a particular date.
commentedOn = '2016-02-14' AND project = VALENTINE
project = APOLLO AND assignee = narmstrong AND commentedOn in ('1969-07-20', '1969-07-21')
The commentedOn keyword can be used with the following operators:in
,not in
,!=
AND=
commentedBy
The commentedBy keyword can be used to search for issues that have comments on them made by a particular user. You must specify a username:
reporter = currentUser() AND commentedBy = 'jsmith'
This keyword can be used with the following operators: in
, not in
, !=
AND =
lastCommentBy
This keyword can be used to search for issues based on the user who made the most recent comment. You must provide a username:
reporter = 'jsmith' AND lastCommentBy = currentUser()
assignee = currentUser() AND lastCommentBy in ('jbond', 'jbauer')
This keyword can be used with the following operators: =
, !=
, in
and not in
Linked Issues
numberOfLinks
This keyword is used to retrieve issues that have a certain number of issue links.
status = Open AND numberOfLinks = 3
We can use numeric comparison operators like >
, <
, !=
, <=
and >=
as well as =
.
numberOfLinks > 5 AND numberOfLinks <= 10
Subtasks
numberOfSubtasks
The numberOfSubtasks keyword can be used to search for issues with a certain number of subtasks.
issuetype = Task AND numberOfSubtasks > 10
This keyword can also use the numeric comparison operators.