Hi.
I have a customfield, that includes a mullti select list with structured information. I try to find a query, that returns any items that start with a certain substring.
Values in the list could be
ABC bla bla bla*
DEF bla bla bla*
but also
ABC DEF bla bla*
I want to contruct a qeury that returns only issues with the strings starting with DEF.
A query issuefunction in issueFieldMatch("filter = 'filter name'", customfield_12345, "DEF") returns both "DEF bla bla" and "ABS DEF bla bla" as expected.
However a query issuefunction in issueFieldMatch("filter = 'filter name'", customfield_12345, "^DEF") or a query issuefunction in issueFieldMatch("filter = 'filter name'", customfield_12345, "^DEF.*$") retrun zero items.
What am I missing or doing wrong?
I am not 100% sure but in regular expression (?m) enables multiline mode so it is worth trying the below one.
issueFunction in issueFieldMatch("filter = 'filter name'", customfield_12345, "(?m)^DEF.*")
Thanks Tuncay.
Didn't think about that. The (?m) didnt't solve the problem, but got me thinking in the right direction. Thanks for that.
The multi select list is not parsed as a set of strings, so I need to prefix with (^|\\s|,) and postfix with a negation, to exclude the bla bla from ABC DEF bla bla.
So thanks for getting my thoughts in the right direction.
Cheers,
/Erik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It makes sense. I'm glad it helped you think in the right direction.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Erik Schumann
Can you share your final expression please?
I'm doing a similar query where I only want labels that start with an exact three letters "iBC" and I don't want "ABC_iBC", if that makes sense?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.