How to search in JQL CF with free or exact text

Create issue
Issue #7 resolved
Adolfo Casari created an issue

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 (10)

  1. Marc Trey repo owner

    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 :

    • '*' is not allowed as first character in wildcard query
    • jira indexing is tailored in a way that '-' is steamed out when it is the first char

    Searching for issue begining with "-" will show no result : 0.png

    But , searching for issue beginning with "1" whill show issue with "-1" and "1" 1.png

    Searching for "-" within the content is ok : 11.png but you must not put a wildcard in first position : 111.png

    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 21.png 2.png

    You can the use a simple jql query for searching positive or negative value 3.png

  2. Adolfo Casari 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.

  3. Marc Trey repo owner

    ok, I will publish a new version that will allow statistic (ie : stattable searcher) for scripted date field and scripted number.

  4. Adolfo Casari 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).

  5. Log in to comment