A JQL Query fails with the error "the operator is not supported by the field"
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Depending on which type of field is used to search for Jira issues in a JQL query, different operators will be available as explained in Advanced searching - operators reference. For example:
Fields of "text" type can be used with the "~" operator
Fields of "select list" type can be used with the "in (...,...,...)" operator
This knowledge article describes a scenario where the JQL search box might return an error when using an operator that is supposed to be supported for a given field. For example:
1
The operator 'in' is not supported by the 'Some Field' field.
1
The operator '~' is not supported by the 'Some Field' field.
Environment
Jira Data Center on any version from 8.0.0
Diagnosis
To verify if this knowledge article is relevant, follow the steps below:
Log in as a Jira Administrator
Go to the page ⚙ > Issues > Custom Fields
Search for the field which caused the error in the issue search page and look at the result
If you see at least 2 fields that are using the exact same name with different types, then this article is relevant.
Another way to verify that multiple fields are using the same name is to start typing the field name in the JQL search. If you see multiple fields suggested in the UI, then this article is relevant.
Cause
There are multiple fields using the same name, but that have different types. Since different types of fields support different operators, when the Jira application tries to execute the JQL query using the field name, it is unable to decide which operator is supported, since the field name can refer to either field and therefore either type. Because of that, the JQL query returns an error saying that the operator used in the query is unsupported.
Solution
There are 2 ways to approach this issue, which are listed below.
Option 1 - Either ensure that all fields have unique names
Ensuring that each field has its own unique name will help avoid any confusion with the execution JQL query performed by the Jira application. When doing so, the Jira application will know which operator(s) are supported with the field used in the JQL query.
To rename any field using the same name:
Log in as a Jira Administrator
Go to ⚙ > Issues > Custom Fields
Search for the field which name has to be changed
Click on ... > Edit next to the field
Change the name, and click Update
Option 2 - Use the custom field ID instead of the field name in the JQL query
For this option, you can follow the steps below:
Log in as a Jira Administrator
Go to ⚙ > Issues > Custom Fields
Search for the field that you need to use in the JQL query
Click on ... > Configure next to the field
Look for the ID at the end of the URL on your browser (this is the custom field ID). Example: [SITEURL]/jira/secure/admin/ConfigureCustomField!default.jspa?customFieldld=10301.
Go back to the JQL query, and instead of using the field name, use the syntax cf[XXXXX] by replacing XXXXX with the custom field ID. Example of JQL: "cf[10301] in ('Option 1', 'Option 2')"
Was this helpful?