Forums

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

Jira Automation and Regex - Escaping?

John March 8, 2022

I have the following regex, which works, but Jira, on the action only, splits the regex on the comma.  How can I fix/prevent this?

 

{{comment.body.match("([A-Z0-9]{2,10}-\d+)")}}

 

x.png

The error returned is:

Link issues
Error linking issues
{{comment.body.match("([A-Z0-9]\{2: Issue does not exist or you do not have permission to see it., 10\}-\d+)")}}: Issue does not exist or you do not have permission to see it.

 

1 answer

0 votes
Mark Segall
Community Champion
March 8, 2022

Hi @John - This one is interesting.  Perhaps try creating a variable and then using the variable to perform the link action?

John March 8, 2022

Great thought.  It seems either Jira cannot handle variables inside smart tags, or I have the wrong syntax.  Looks like it was a know jira limitation a few years back, not certain if it's been fixed.

 

Error linking issues 
{{comment.body.match({{myRegex}})}}: Issue does not exist or you do not have permission to see it.
Mark Segall
Community Champion
March 9, 2022

Yeah that's unfortunate.  I wish I were a regex ninja or I'd offer up another way of tackling the problem.  Hopefully someone else in the community can help.

Like John likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events