How to generate a LIKE JQL for a custom field in basic search?

Philip Wiley April 14, 2013

I have a custom field that contains free text and can be searched with the LIKE operator. This works fine in the advanced search: myField ~ "some word". However the basic search is generating JQL with an equals operator. For example: myField = "some word".

How/where do I configure a basic search component to generate JQL with a LIKE instead of an EQUAL operator?

3 answers

1 accepted

2 votes
Answer accepted
Philip Wiley April 22, 2013

Sorry, didn't make it clear enough that I was struggling through the code trying to implement functionallity. I found the answer, you need to override and generate new clauses in AbstractCustomFieldSearchInputTransformer.getClauseFromParams(). A good example can be found in Atlassians source code in NumberRangeCustomFieldSearchInputTransformer.java.

Thanks again for taking the time.

6 votes
Roman Kuznetsov April 22, 2013

You can use "*" or "?" symbols for both the basic search and the advanced search:

myField ~ "some word*"

More information: https://confluence.atlassian.com/display/JIRA/Performing+Text+Searches

Sohail Anwar June 17, 2019

thanks

1 vote
Ramiro Pointis
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 15, 2013

Hi Philip, which JIRA version do you have? In the version 5.2 that's working like that. You can select the custom field and indicate the words, then change to Advance View and there shows the ~ operator.

Suggest an answer

Log in or Sign up to answer