Using wildcards in JQL search leads to errors
Platform Notice: Cloud - This article applies to Atlassian products on the cloud platform.
Summary
Sometimes, using wildcards in JQL search leads to errors.
For example, we need to search for all issues where the field "version" has values that start with "abc". Please refer to the below example and error.
JQL - "version" ~ "abc*"
Error - Terminal clause [abc*] resolves to too many literals
Environment
Non-working: Jira cloud
Working: JIRA server
Diagnosis
If we change the query a little and search for a more discrete value using a wildcard it may work. In our example, consider version field has the following values:
- abc 22.1
- abc 22.2
- abc 22.3
- abc 22.4
Here we can use search something like the below and it will work without any issues.
"version" ~ "abc 22.*"
Cause
This constraint has been added cautiously to improve performance. This also makes sure that we do not exceed the limit of arguments passed to the database.
Solution
Use a more discrete search so that we do not exceed the limit mentioned above.