How to search in JQL CF with free or exact text
I have customfield that contain values with a minus sign. I can't find a way to search in JQL for issues that do not contain a minus value in this CF. I have tried both free and exact text, ut I can't get to the right JQL syntax.
Note: customfield is of type scripted field (from script runner plugin). This return strings that represents integers (positive and negative).
Thanks in advance,
Comments (11)
-
repo owner -
repo owner - changed status to resolved
-
reporter Thanks for your complete description. Unfortunately, scriptrunner scripted fields seems not to support Numeric(stats), since when I create the CF only the text(stat) searchers are available. Numeric is available, but only the one from Jira, not the plugin.
-
repo owner - changed status to open
-
repo owner -
assigned issue to
- marked as enhancement
-
assigned issue to
-
repo owner ok, I will publish a new version that will allow statistic (ie : stattable searcher) for scripted date field and scripted number.
-
repo owner - changed status to resolved
Here is version 1.1.4 and a wiki page for scripted fields searcher configuration.
please have a look. best regards.
-
reporter Thanks a lot for your help!
(I only wonder why the 2 dimensional gadget shows integer values with a decimal point and 0. On Issue screens and Navigator shown as pure integers).
-
repo owner Here is version 1.1.5 wich will display numbers with the correct format... sorry for that .
-
reporter Perfect!
-
To search in JQL (Jira Query Language) using a custom field (CF) for free or exact text, you can use the "~" and "=" operators respectively. Here's how you can do it:
-
For free text search:
- To search for issues where the custom field contains a specific word or phrase, you can use the "~" operator along with the CF name and the text you want to search for. For example:
cfName ~ "text"
- This will retrieve issues where the custom field (cfName) contains the specified text (text), regardless of the case or word boundaries.
- To search for issues where the custom field contains a specific word or phrase, you can use the "~" operator along with the CF name and the text you want to search for. For example:
-
For exact text search:
- To search for issues where the custom field has an exact match for a specific word or phrase, you can use the "=" operator along with the CF name and the text you want to search for. For example:
cfName = "text"
- This will retrieve issues where the custom field (cfName) has an exact match for the specified text (text), considering the case and word boundaries.
- To search for issues where the custom field has an exact match for a specific word or phrase, you can use the "=" operator along with the CF name and the text you want to search for. For example:
Remember to replace "cfName" with the actual name of your custom field in Jira. Also, note that the search syntax and available operators may depend on the version of Jira you are using.
If you have multiple custom fields or want to combine multiple conditions in your JQL query, you can use logical operators such as "AND" and "OR". Here's an example of a JQL query combining multiple conditions:
javaCopy codecfName1 ~ "text1" AND cfName2 = "text2"
This query will search for issues where cfName1 contains "text1" and cfName2 has an exact match for "text2".
I hope this helps! Check my latest chat gpt detector tool.
-
- Log in to comment
here is how to "Performing Text Searches"
While it is ok to store numerical value, you should not use text custom field for searching numerical value. Here are the reason :
Searching for issue begining with "-" will show no result :
But , searching for issue beginning with "1" whill show issue with "-1" and "1"
Searching for "-" within the content is ok : but you must not put a wildcard in first position :
it also appears that the text custom field will not allow certain value; ie : "-1" (if the string is less than 3 char and begins with a wildcard , sounds like a jira bug.. but you should not use a text field for a numeric value).
Solution
Use a Numeric Custom field
You can the use a simple jql query for searching positive or negative value