Using script runner to fire issue_commented when issue is updated?


I do not want to use the general "Issue Updated" from Jira since it causes my Jira installation to be verbose towards being spammy. Instead I rely on using "Issue Commented" and that works most of the time.

Jira has the annoying happit of sending an "Issue Updated" instead of "Issue Commented" whenever a customer sends an email with any kind of attachment. This means that all the customers who attach an image as part of their signature will cause Jira to send an "Issue Updated" instead of the Commented. The result is that I cannot get my AutoTransitionListener to reopen cases, jump out of the status "Waiting for customer" etc.

My idea was to use the Groovy Script Runner to issue the "Issue Commented" whenever an update included both an attachment and a comment, but I am all new to the script runner.

Unfortunately I cannot find the syntax for verifying that "There was a comment" as part of the update.

As far as I can see in various documentation, this would verify that there is an attachment in the update : "attachmentManager.getAttachments(issue).size() >= 1" or perhaps this could be used "issueFunction in hasAttachments ()".

But I cannot find an example of how to verify if this particular update had a comment in it?

Any assistance would be highly appreaciated.

Best regards

- Niels

2 answers

Might try

List attachments = attachmentManager.getAttachments(issue)
if (!attachments.isEmpty()) {.........}

This is a great question.  Does anyone have an answer to this?

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,802 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot