Forums

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

Automatically Linking Issue From Comments

Bryan Rogers
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!
April 18, 2022

I am trying to follow the instructions in this blog post to setup automatic issue linking when an issue is mentioned in the comments.

When I test, I am able to get a successful run of the automation when I use a regex that is looking for a specific issue key, but when I use a generic regex to look for any project key, it fails. When I test the regex itself on an online tool, it successfully finds the issue key regardless of location in a comment so I don't think this is a regex specific issue.

Successful Automation: {{comment.body.match(“(ABC-\d+)")}}

Unsuccessful Automation: {{comment.body.match(“([A-Z]+-\d+)")}}

 

There was at one point a bug posted for this, but was closed as cannot reproduce which is not the case for me. Any guidance on how to configure this to avoid creating an automation rule for every project we have would be appreciated.

1 answer

1 accepted

0 votes
Answer accepted
Mark Segall
Community Champion
April 18, 2022 edited

Hi @Bryan Rogers and welcome to the community!

I have a rule based upon this premise that works well for me where I use a similar regex:

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

However, one thing I do is capture this in a variable and then use that variable for my later action.

Also, make sure that your rule scope is set to global (or at least multiple projects) if you intend it to span multiple projects.

Bryan Rogers
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!
April 18, 2022

Well what do you know, my regex worked perfectly once put into a branch/variable. Thanks Mark!

Like Mark Segall likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events