Allow tokenization across -

Issue #15 wontfix
Former user created an issue

We have a field which contains text entries in the form XX-YYY-####. We currently use the exact text searcher to aggregate a list of how many tickets contain duplicates. We would like to create a filter that would pick out specific YYY values.

The current behavior with the contains operator (~) seems to only work when the YYY value is listed as regular text (as a separate word) in the field, but not when it is in the standard form. That suggests to me that XX-YYY-#### is being tokenized as a single word, rather than as components. Alternately, if there were a way for contains to search any substring regardless of tokenization would meet our needs.

Concrete Example: "Affected Item" ~ "\"SIS\"" -> Entries with " SIS " in the field, but not entries with "XX-SIS-####"

Comments (8)

  1. &(*&)#)_*#@@(*)(@*)(*@ repo owner

    this is correct, XX-YYY-#### is being tokenized as a single word.

    A simple workaround is to use '.' instead of '-', i.e : XX.YYY.####

    this would produce exactly what you are looking for :

    code ~ "\"YYY\""  or  code  ~ "\"XX\""   or code  ~ "\"XX.YYY.0001\"" 
    

    Screen Shot 2017-10-05 at 16.43.41.png

    code  ~ "\"XYZ\""
    

    Screen Shot 2017-10-05 at 16.54.56.png

    with the format 'XX-YYY-####' you can only match the beginning of a word and there seem to be an issue with the character '-' ..

    you can match 'XY', 'XY-' but not 'XY-MMM' nor 'MMM'

    code ~  "\"XY\\-\"" 
    

    Screen Shot 2017-10-05 at 17.11.40.png

    code  ~ "\"XX\\-XYZ\\-0001\""  or code  ~ "\"XX\"" or code  ~ "\"MMM\"" or code  ~ "\"XY\""
    

    Screen Shot 2017-10-05 at 17.06.20.png

  2. &(*&)#)_*#@@(*)(@*)(*@ repo owner

    Please use '.' instead of '-' to allow tokenization while retaining the correct indexed value.

    If one have no control on the input itself or is bound to use '-' this could be done with a scripted field.

    Screen Shot 2017-10-05 at 17.38.14.png

  3. Nathan Mogk

    I am locked into the field format, unfortunately. I have never done a scripted field, but I will give that a try.

  4. &(*&)#)_*#@@(*)(@*)(*@ repo owner
    <!-- @@Formula: issue.get("customfield_10200")==null ? null : issue.get("customfield_10200").replaceAll("-",".") -->
    

    Screen Shot 2017-10-05 at 19.01.54.png

    Screen Shot 2017-10-05 at 19.02.37.png

    Screen Shot 2017-10-05 at 19.02.58.png

  5. Nathan Mogk

    So I have the script you described in a custom text field like in your first screen shot. I have updated the field ID to be the proper one too, but it isn't working. Do I have to input the script into another place? Another plugin perhaps?

  6. &(*&)#)_*#@@(*)(@*)(*@ repo owner

    if we chose to allow tokenization then it should be done with a configurable character or list of characters.

    using a scripted field to handle the logic is an acceptable workaround (for now).

  7. Log in to comment