Additional and useful JQL functions to search issues using the power of regex expressions. |
A simple example of a regular expression is a (literal) string. For example, the "Hello World" regex matches the "Hello World" string.
"." (dot) is another example of a regular expression. A dot matches with any single character; it matches, for example, with "a" or "1". The following table lists several regular expressions and describes with which search query pattern they would match.
Regex | Matches |
---|---|
this is text | Matches exactly "this is text" |
this\s+is\s+text | Matches the word "this" followed by one or more whitespace characters followed by the word "is" followed by one or more whitespace characters followed by the word "text". |
^\d+(.\d+)? | ^ defines that the pattern of the search query must start with the beginning of a new line. \d+ matches one or several digits. The ? makes the statement in brackets optional. . matches ".", brackets are used for grouping. Matches for example with "5", "1.5" and "2.21". |
For details please vistit https://regexone.com or https://www.regular-expressions.info/java.html
powerIssue([JQL subquery, optional], "field names", "regex expression")
Field | JQL |
---|---|
summary | issue in powerIssue("summary", ".*") |
description | issue in powerIssue("description", ".*") |
Case example
Task | JQL |
---|---|
Simple usage - find any issue with the word "amber" in the beginning of the Summary field | issue in powerIssue("summary", "(amber).*") |
Any issue from POWERJQL project, where summary or description contains "text1" or "text2" (case-insensitive) | issue in powerIssue("project=POWERJQL", "summary, description", "(?i).*(text1 | text2).*") |
Field | JQL |
---|---|
assignee | issue in powerIssue("assignee", "Jackson") |
reporter | issue in powerIssue("reporter", "Lucas") |
creator | issue in powerIssue("creator", "Liam") |
Case example
Task | JQL |
---|---|
Any issue where assignee name contains "Michael" (case insensitive) | issue in powerIssue("assignee", "(?i).*(Michael).*") |
To search by date field use pattern "yyyy/MM/dd HH:mm"
Field | JQL |
---|---|
created | issue in powerIssue("created", "2017.*") |
updated | issue in powerIssue("updated", "2017/08/26.*") |
due, duedate | issue in powerIssue("due", "2017/08/26.*") |
resolutiondate | issue in powerIssue("resolutiondate", "2017/08.*") |
Field | JQL | Notes |
---|---|---|
fixVersion | issue in powerIssue("fixVersion", ".(8\.5.).") | to find all tickets with fix versions like 8.5.1, 8.5.2, 8.5.1.1 etc. |
affectedVersion | issue in powerIssue("affectedVersion", ".(1\.0.).") | to find all tickets with affected versions like 1.0.1, 1.0.2, 1.0.1.1 etc. |
Sprint | JQL |
---|---|
Any issue where sprint name contains "sample" (case insensitive) | issue in powerIssue("sprint", "(?i).*(sample).*") |
As you know, the following English reserved words (also known as 'stop words') are ignored from the search index in Jira 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"
But not in our app! You can use all or any combinations of this word for text search in "powerIssue" search function.
powerComponent([JQL subquery, optional], "regex expression") Can be used with 1 or 2 arguments.
Case example
Any not resolved issues where any component contains words "mobile" or "dev" in any part of component name (case sensitive):
component in powerComponent("resolution=EMPTY", ".*(mobile | dev).*")
powerAttachment([JQL subquery, optional], regex expression)
Case example
issue in powerAttachment(".*(?=android).*(?=pdf).*")
powerProject(regex expression)
Case example
project in powerProject(".(Customer).")
This function allows to filter tickets based on three keywords: comment, total, count. All these keywords filter from worklogs.
Below, there are examples for each one of them.
Case | JQL |
---|---|
1 | issue in powerWorklog("comment", ".*devops.*") |
2 | issue in powerWorklog("project=SAMPLE", "comment", ".*devops.*") |
Examples:
This keyword, "total", allows filtering based on worked time. In order to get result(s), incorporate comparison signs( > , < , != , = ) and letters ( w=week , d=day , h=hour , m=minute).
It should be noted that one week is 40 hours and one day is 8 hours.
Case | JQL |
---|---|
1 | issue in powerWorklog("total", "<1w1d4h") |
2 | issue in powerWorklog("project=SAMPLE", "total", "<1w1d4h") |
Examples:
This keyword, "count", allows filtering based on number logged worklog. In order to get result(s), incorporate comparison signs( > , < , != , = ).
Case | JQL |
---|---|
1 | issue in powerWorklog("count", "!=1") |
2 | issue in powerWorklog("project=SAMPLE", "count", "!=2") |
Examples:
issue in powerHistory("some JQL", "fieldname", "regex expression")issue in powerHistory("fieldname", "regex expression")
Case example:
issue in powerHistory("project = TD", "description", ".*demo space.*")
assignee in powerUser("fieldname", "regex expression")
Allowed fields:
Case example:
Find all the tickets where assignee has German locale in User Preferences:
assignee in powerUser("preference=jira.user.locale","de.*")
Find all the tickets created by a users which user names starts with "andr":
creator in powerUser("username","andr.*")
Find all the tickets where Reporter's display name contains "john" case insensitive ("(?i)" search modifier):
reporter in powerUser("displayName","(?i).*john.*")
Case | JQL | Notes |
---|---|---|
1 | issue in mentionedWithoutResponse("JQL subquery") | to get all tickets where the current user has been mentioned but without response |
2 | issue in mentionedWithoutResponse("JQL subquery", "userName") | to get all tickets where "userName" has been mentioned but without response: |
3 | issue in mentionedWithoutResponse("JQL subquery", "currentUser()") | to get all tickets where current logged in user has been mentioned without response |
.*([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}).* |
issue in powerIssue("project is not empty", "comment", ".*([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,6}).*") |
email@example.com |
.*https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#()?&//=]*).* |
issue in powerIssue("project = TEST", "summary", ".*https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{2,256}\\.[a-z]{2,6}\\b([-a-zA-Z0-9@:%_\\+.~#()?&//=]*).*") |
.*(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).* |
issue in powerIssue("project = TEST", "summary", ".*(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).*") |
0.0.0.0 |
.*(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])).* |
issue in powerIssue("project = TEST", "summary", ".*(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])).*") |
1200:0000:AB00:1234:0000:2552:7777:1313 |
.*([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])).* |
issue in powerIssue("project = TEST", "summary", ".*([12]\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])).*") |
2008-09-31 1600-12-25 |
.*<\\/?[\\w\\s]*>|<.+[\\W]>.* |
issue in powerIssue("project = TEST", "description", ".*<\\/?[\\w\\s]*>|<.+[\\W]>.*") |
<h2 class="offscreen">Webontwikkeling leren</h2> |