Forums

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

Jira automation - linking issue rule throwing errors when I wouldn't expect the rule to run

Kara Nadarajah
Contributor
August 6, 2020

I have set up a Jira automation rule which seeks to link issues via issue links (relates to) if someone comments with a Jira reference on the ticket.

However, every time someone comments and the comment does not include a Jira ticket reference, the rule is throwing an error.  In this case I wouldn't expect the rule to work since nobody has commented a Jira ticket reference.  The comments do include our own internal references or dates, but why does Jira throw an error with the automation rule in this case?  Is the regex i've used incorrect? Our ticket references begin 'FB-'

I followed the steps on this blog to set the rule up - https://blog.codebarrel.io/automatically-linking-issues-just-got-that-much-easier-25601d552e5a

Screenshot 2020-08-06 at 09.01.23.png

1 answer

1 accepted

0 votes
Answer accepted
John Funk
Community Champion
August 6, 2020

Hi Kara,

The issue is going to run every time a comment is added based on the trigger you have. 

But you should probably add a Condition between the two steps so it doesn't try to do the Link Issue part if it's not valid. 

Kara Nadarajah
Contributor
August 6, 2020

Thanks - can you tell me what condition I would add?

John Funk
Community Champion
August 6, 2020

Sounds like you need JQL - but I am not sure what criteria you are using. When is it you want to fire and link?

Kara Nadarajah
Contributor
August 6, 2020

When someone comments on a ticket and the comment includes a Jira ticket reference, I want the tickets to link via the 'relates to' link

John Funk
Community Champion
August 6, 2020

So how will you know there is a Jira ticket reference? Are you able to parse out some text? Maybe something like Summary ~ "FB-"

Kara Nadarajah
Contributor
August 6, 2020

I thought that's what the regex above was doing? I have followed the instructions on that blog  https://blog.codebarrel.io/automatically-linking-issues-just-got-that-much-easier-25601d552e5a

But have replaced their ticket AUT with my project ticket reference of FB

John Funk
Community Champion
August 6, 2020

That would cause it to fail with an error - which it does. The condition would just keep from sending you an error. 

Kara Nadarajah
Contributor
August 7, 2020

So how do I solve this problem? I don't know what JQL or condition to use.  Thanks

John Funk
Community Champion
August 8, 2020

How EXACTLY are you identifying Jira ticket references?

Kara Nadarajah
Contributor
August 10, 2020

With what I have provided in the screenshot above, which I obtained by following the instructions on that blog I have referenced.

John Funk
Community Champion
August 10, 2020

Not sure I am following but what I am gathering is that your are using FB- to see if there is a Jira Issue reference. If not, I have not idea what your criteria is.

So, maybe something like Summary ~ "FB-" in your condition. 

Kara Nadarajah
Contributor
August 10, 2020

Yes, our ticket numbers start with FB-

As mentioned above, if someone makes a comment on a ticket and that comment includes FB-xxxx then I want the Jira automation to automatically link the ticket mentioned in the comment to the ticket being commented on.

I thought that is what I had set up based on the instructions in that blog, but obviously not and it's very confusing for something that seems like it should be simple....

John Funk
Community Champion
August 10, 2020

It is but you said you are getting errors when the issue doesn’t have the FB- reference. The way to avoid that is to move the check to a condition before the link.

Kara Nadarajah
Contributor
August 10, 2020

Thanks, but I don't know about Summary ~ "FB-" since the ticket reference won't be in the summary? Should it be Comment ~ "FB-" instead?

John Funk
Community Champion
August 10, 2020

Yes, I'm sorry - should have been Comment not Summary  :-(

Kara Nadarajah
Contributor
August 10, 2020

Great, thanks, I'll give that a go, hopefully that's the end of that haha 😊

John Funk
Community Champion
August 10, 2020

It's definitely frustrating to get error messages when it just didn't find anything that was corresponding. The Condition is definitely your friend there. 

Kara Nadarajah
Contributor
August 11, 2020

Great, that's worked now, no longer getting errors, thanks!

John Funk
Community Champion
August 11, 2020

Awesome!

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events