I'm trying to use the issueFieldMatch regex and the results are not as expected. I have issues with labels "COMMITTED" and "UNCOMMITTED". If I use: issueFunction in issueFieldMatch("project=TEST", labels, 'COMMITTED'), it returns the issues with both "COMMITTED" and "UNCOMMITTED" (as expected for searching anywhere in the string). However, if I use: issueFunction in issueFieldMatch("project=TEST", labels, '^COMMITTED$') then it returns no results.
I cannot find any regex pattern that will return an exact match to "COMMITTED" and exclude the "UNCOMMITTED". ^*COMMITTED returns the UNCOMMITTED and COMMITTED. Negative lookahead doesn't seem to work - i.e. ^*(?!UNCOMMITTED)COMMITTED* returns UNCOMMITTED and COMMITTED. ^(?!UNCOMMITTED)COMMITTED* returns nothing.
I have a more complex query expression that I want to replace "project=TEST", but I need the regex to work first.
I think I've found a partial answer. JIRA seems to add an unprintable character at the beginning of the label field. This works (only returns issues with "COMMITTED" labels):
issueFunction in issueFieldMatch("project=TJPF", labels, '^.COMMITTED')
Adding the anchor is not the entire solution. If the issue has several labels, then the anchor will only force a match with the first label. For example, if the issue also had a label "2018Q1", that label would be listed alphabetically before "COMMITTED" and then the above regex will not return the issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.