Versions Compared

Key

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


UI Text Box
sizemedium
typeinfo

This very powerful JQL function combines the power of classic JQL and JWT, by letting you refine your JQL subquery using a JWT logical expression

The function works in the following way:

  1. The JQL subquery will be evaluated first and return a number of issues
  2. These issues will then be run against a logical expression
  3. Issues where the expression returns TRUE will be returned by the overall JQL query 

Example

Code Block
languagebash
linenumberstrue
issue in issueSelection('project = DESK', '%{issue.subtasks.count} >= 1')
  1. The JQL subquery will return all issues from the DESK project
  2. The logical expression will check whether these issues have at least one sub-task.
  3. The JQL function will only return the issues with sub-tasks.


Code Block
languagebash
titleSyntax
linenumberstrue
issueSelection(subquery, logicalExpression) #Output: Issue list


UI Expand
titleExamples


Parser expressionDescription


Code Block
languagebash
linenumberstrue
issue in issueSelection('project = QA', '%{issue.assignee} = %{issue.reporter}')


This example returns all issues within the QA project where the reporter is also the current assignee


Code Block
languagebash
linenumberstrue
issue in issueSelection('type = Story', '%{issue.subtasks.count} >= 1')


This examples returns all stories that have at least one sub-task.


Code Block
languagebash
linenumberstrue
issue in issueSelection('project = CRM', 'count(allComments()) > 10')


This example returns all issues within the CRM project with more than 10 comments.

To achieve this, the following functions are used:


Code Block
languagebash
linenumberstrue
issue in issueSelection('category = Support', 'count(filterByResolution(subtasks(), "")) > 0')


This example returns all issues from projects within the Support category with unresolved sub-tasks.

To achieve this, the following functions are used:


Code Block
languagebash
linenumberstrue
issue in issueSelection('type = Task', 'isAClone()')


This example returns all tasks that have been created by cloning an issue.

To achieve this, the following functions are used:


Code Block
languagebash
linenumberstrue
issue in issueSelection('project = KANBAN', 'isInRole(%{issue.assignee}, "Developers")')


This example returns all issues within the KANBAN project that are assigned to users in the Developers role.

To achieve this, the following functions are used:


Code Block
languagebash
linenumberstrue
issue in issueSelection('type = Incident', 'lastFieldChangeTime(%{issue.priority}) > ({system.currentDateTime} - 60 * {MINUTE})')


This example returns all Incidents with a change of priority within the last 60 minutes.

To achieve this, the following functions are used:


Code Block
languagebash
linenumberstrue
issue in issueSelection("type = Bug and resolution = Unresolved", 'matches(%{issue.versions}, ".*EAP.*")')


This example returns all unresolved Bugs with a 'EAP'-labelled version.


Code Block
languagebash
linenumberstrue
issue in issueSelection("project = HR", '!isActive(%{issue.assignee})')


This example returns all issues within the HR project that are assigned to inactive users.


Code Block
languagebash
linenumberstrue
issue in issueSelection("project = JWT", 'matches(%{issue.attachments.details}, "(.*application/pdf.*){1,}")')


This example returns all issues within the JWT project that have at least one PDF file attached.



UI Expand
titleAdditional information

Parameters used in this function

ParameterInput (data type)Description
subquery

Status
subtletrue
titletext

A JQL query to select the issues that should be further filtered by the logical expression.

(warning) The subquery must not be empty to avoid negative performance impacts. Always try to keep the number issues returned by the subquery as minimal as possible.

logicalExpression

Status
subtletrue
titletext

A logical expression that returns a boolean value. See additional examples and learn how to build logical expressions here.

Include Page
DECADIS:_snip_proTip_JQL
DECADIS:_snip_proTip_JQL


UI Expand
titleOutput

This function returns an 

Status
subtletrue
titleissue list


Include Page
DECADIS:_snip_limit_JQL_functions
DECADIS:_snip_limit_JQL_functions


Use cases and examples

Page properties report
firstcolumnUse case
headingsJQL function
cqllabel = "jql_func_issueselection" and space = currentSpace()


Page properties
hiddentrue


Short descriptionReturns issues that satisfy both a JQL query and a JWT logical expression
Output

Status
subtletrue
titleISSUE LIST

Label

Status
colourRed
titlestaff pick




Page properties
hiddentrue



Status
Tech review

Status
colourYellow
titleReady for review
Status
colourRed
titleflagged
 

Style guide

Status
colourGreen
titledone

Status
titletodo
Status
colourYellow
titleReady for review
Status
colourGreen
titledone
Status
colourRed
titleflagged