JQL extension for custom fields
On this page:
Extended JQL syntax
The "Custom JQL" mode and the JQL filtering functionality of Issue Matrix for Jira support an extended JQL syntax which allows filtering based on the values of custom fields of the current issue.
There are several forms of the extended syntax you can use for custom fields:
Retrieving the custom field value using the id of the custom field
customField = ${currentIssue.cf[10006]}
Â
Retrieving the custom field value using the name of the custom field
customField = ${currentIssue.cf["Custom field name"]}
Â
Retrieving the issues with the same value(s) as in the labels/multi version picker field value(s) in the current issue as well as all issues with empty value for the custom field. Only applicable for custom fields of type Labels custom field type: "com.atlassian.jira.plugin.system.customfieldtypes:labels", Multi version picker custom field type: "com.atlassian.jira.plugin.system.customfieldtypes:multiversion".
by custom field ID:
"Profession labels" IN (${currentIssue.cf[10005]}, EMPTY)
by custom field name:
Jira allows multiple custom fields with the same name but different type. In this case, the fields that have applicable context for the specific issue will be preferred, but if there are multiple such fields or if none of them has context for the issue the result will be indeterminate. This is why when there are multiple custom fields with the same name it is preferable to use the custom field id.
Supported custom field types
Jira comes with a predefined set of custom field types - for example, date picker or user multi-picker. Marketplace apps can add their own custom field types.
Below is a list of all the supported custom field types with examples on how to use them.
For all other custom field types, the replaced value is the value returned by the Jira API. This means that if the custom field value is an object which has a getNumber() method which returns 333 for a specific issue, the syntaxÂ
is valid and the evaluated JQL for the specific issue will beÂ
List of supported custom field types
- 1 Checkboxes
- 2 Date Picker
- 3 Date Time Picker
- 4 Group Picker
- 5 Multi-group Picker
- 6 Labels
- 7 Number Field
- 8 Project pickerÂ
- 9 Radio ButtonsÂ
- 10 Select List (single)
- 11 Select List (multi)
- 12 Text field
- 13 Text field (read-only)
- 14 URL field
- 15 User PickerÂ
- 16 User Picker (multi)
- 17 Version PickerÂ
- 18 Version Picker (multi)
Checkboxes
Return value description | Comma-separated list of the value of the selected options surrounded by double quotes |
---|---|
Return value example | "Option 1", "Option 2" |
Examples |
|
Date Picker
Return value description | String in the format "yyyy/MM/dd" surrounded by double quotes. |
---|---|
Return value example | "2017/12/30" |
Examples |
|
Date Time Picker
Return value description | Time string in the format "yyyy/MM/dd HH:mm" surrounded by double quotes. |
---|---|
Return value example | "2017/12/30 09:30" |
Examples |
|
Group Picker
Return value description | The group name surrounded by double quotes. |
---|---|
Return value example | "jira-administrators" |
Examples |
|
Multi-group Picker
Return value description | Comma separated list of group names surrounded by double quotes |
---|---|
Return value example | "jira-administrators", "jira-developers" |
Examples |
|
Labels
Return value description | Comma-separated list of label names surrounded by double quotes |
---|---|
Return value example | "Orange", "Green" |
Examples |
|
Number Field
Return value description | The value of the field. |
---|---|
Return value example | 20 |
Examples |
|
Project pickerÂ
Return value description | The key of the project |
---|---|
Return value example | TSP |
Examples |
|
Radio ButtonsÂ
Return value description | The value of the selected option surrounded by double quotes |
---|---|
Return value example | "Option 1" |
Examples |
|
Select List (single)
Return value description | The value of the selected option surrounded by double quotes |
---|---|
Return value example | "Selection 1" |
Examples |
|
Select List (multi)
Return value description | Comma-separated list of the value of the selected options surrounded by double quotes |
---|---|
Return value example | "Selection 1", "selection 2"Â |
Examples |
|
Text field
Return value description | The text field value surrounded by double quotes. |
---|---|
Return value example | "Sample text" |
Examples |
|
Text field (read-only)
Return value description | The text field value surrounded by double quotes. |
---|---|
Return value example | "Sample text" |
Examples |
|
URL field
Return value description | The URL field value surrounded by double quotes. |
---|---|
Return value example | |
Examples |
|
User PickerÂ
Return value description | The username of the selected user surrounded by double quotes |
---|---|
Return value example | "Admin Username" |
Examples |
|
User Picker (multi)
Return value description | Comma-separated list of usernames of the selected users each surrounded by double quotes |
---|---|
Return value example | "Admin Username", "Fred Normal" |
Examples |
|
Version PickerÂ
Return value description | The id of the selected version |
---|---|
Return value example | 10001 |
Examples |
|
Version Picker (multi)
Return value description | Comma-separated list of the ids of the selected versions |
---|---|
Return value example | |
Examples |
|
Â