Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble with the issueFieldMatch

Aric Turner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 19, 2018

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. 

1 answer

0 votes
Aric Turner
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 20, 2018

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events