Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

JQL Functions

Table of Contents

Syntax


RegEx Evaluator

Code Block
FieldValueMatches("Field_Name", "Regex_Pattern")


Items

Explanation

JQL: FieldValueMatches

Return all the issues whose specific field value matches the "Regex_Pattern"

JQL Context

issue in/not in

Arg: Field_Name

Support any text-based fields. i.e. "Summary", "Description", ' text field (single line)' and so on

Arg: Regex_Pattern

Support any regular expression patterns

JQL Example

'issue in FieldValueMatches("summary", "[hm]at")' will return all the issues whose summary contains hat or mat

Previous Status

Code Block
preStatusWas("status_A")
preStatusContainsAll("status_A, status_B, status_C,..., status_X")
preStatusContainsEither("status_A, status_B, status_C,..., status_X")


Items

Explanation

JQL: preStatusWas

Return all the issues whose most recently previous status is status_A

JQL: preStatusContainsAll

Return all the issues whose historical statuses (exclude current status) include status_A and status_B and status_C and ... and status_X

JQL:preStatusContainsEither

Return all the issues whose most recently previous status is status_A or status_B or status_C or ... or status_X

JQL Context

issue in/not in

Arg: status_X

Support all JIRA workflow statuses

JQL Example

Here's 4 example issues with their workflow transition history:

  1. issue 1: Open

  2. issue 2: Open – In Progress

  3. issue 3: Open – In Progress – Under Review

  4. issue 4: Open – In Progress – Under Review – Rejected – In Progress

'issue in preStatusWas("Rejected")' will return issue 4
'issue in preStatusContainsAll("open, in progress")' will return issue 3 and issue 4
'issue in preStatusContainsEither("open, in progress")' will return issue 2 and issue 3

* Automating high volume queries may result in a slowdown in performance


Date Comparisons

Code Block
datesWithin("Time_Frame", "Date_Field_Name_1", "Date_Field_Name_2")
datesBeyond("Time_Frame", "Date_Field_Name_1", "Date_Field_Name_2")
dateTimeWithin("Time_Frame", "DateTime_Field_Name_1", "DateTime_Field_Name_2")
dateTimeBeyond("Time_Frame", "DateTime_Field_Name_1", "DateTime_Field_Name_2")


Items

Explanation

JQL: datesWithin

Return all the issues whose time difference between "Date_Field_Name_1" and "Date_Field_Name_2" <= "Time_Frame"

JQL: datesBeyond

Return all the issues whose time difference between "Date_Field_Name_1" and "Date_Field_Name_2" >= "Time_Frame"

JQL: dateTimeWithin

Return all the issues whose time difference between "DateTime_Field_Name_1" and "DateTime_Field_Name_2" <= "Time_Frame"

JQL: dateTimeBeyond

Return all the issues whose time difference between "DateTime_Field_Name_1" and "DateTime_Field_Name_2" >= "Time_Frame"

JQL Context

issue in/not in

Arg: Time_Frame

Time frame can be w, d, h, m and separated by spaces.

  • w: week

  • d: day

  • h: hour

  • m: minute

Example: "1w 2d 3h 4m"

Arg: Date_Field_Name_1&2

Support

  • "due": issue due date

and any other Date Picker custom fields

Arg: DateTime_Field_Name_1&2

Support

  • "created": issue created datetime

  • "updated": issue updated datetime

  • "resolved": issue resolved datetime

and any other DateTime Picker custom fields

JQL Example

issue in dateTimeWithin("3d 8h", "created", "updated")

Code Block
issueLinkType("Issue_Link_Type")


Items

Explanation

JQL: issueLinkType

Return all the issues that have a certain type of issue link

JQL Context

issue in/not in

Arg: Issue_Link_Type

Support all issue link types. i.e. "blocks", "is blocked by", "duplicates", "relates to" and so on

JQL Example

'issue in issueLinkType("clones")' will return all the issues whose issue link type is "clones"

Member-of-Role

Code Block
membersOfRole("Project_Role")


Items

Explanation

JQL: membersOfRole

Return all the issues where a specified user is in a specific project role.

JQL Context

  • creator in/not in

  • assignee in/not in

  • reporter in/not in

  • voter in/not in

  • watcher in/not in

Arg: Project_Role

Support all JIRA project roles

JQL Example

assignee in membersOfRole("Administrators")

Time-in-Status

Code Block
timeWithin("Time_Frame", "Status_A", "Status_B", "Status_C")
timeBeyond("Time_Frame", "Status_A", "Status_B", "Status_C")


Items

Explanation

JQL: timeWithin

Return all the issues whose sum of time spent in certain statuses <= "Time_Frame"

  • At least 1 status and up to 3 statuses in the JQL statement

  • If Status_A isn't an issue's historical status, the time spent for that issue in Status_A will be 0

  • It won't return the issue if all the given statuses aren't that issue's historical statuses

JQL: timeBeyond

Return all the issues whose sum of time spent in certain statuses >= "Time_Frame"

  • At least 1 status and up to 3 statuses in the JQL statement

  • If Status_A isn't an issue's historical status, the time spent for that issue in Status_A will be 0

  • It won't return the issue if all the given statuses aren't that issue's historical statuses

JQL Context

issue in/not in

Arg: Time_Frame

Time frame can be w, d, h, m, s and separated by spaces.

  • w: week

  • d: day

  • h: hour

  • m: minute

  • s: second

Example: "1w 2d 3h 4m 5s"

Arg: status_A&B&C

Support all JIRA workflow statuses

JQL Example

issue in timeWithin("1h", "In Progress")

issue in timeBeyond("1d 2h 30s", "Open")

Linked-to-Epic

Code Block
epicTree("Epic_Issue_Key_1", "Epic_Issue_Key_2", ..., "Epic_Issue_Key_N")


Items

Explanation

JQL: epicTree

Return all epics with those given epic issue keys, all issues linked to those epics and all sub-tasks of those issues linked to the epics

  • at least 1 epic issue key and up to unlimited epic issue keys in JQL statement

JQL Context

issue in/not in

Arg: Epic_Issue_Key_N

Support all JIRA Epic issue keys

JQL Example

issue in epicTree("Data Storage", "System Config", "Security")