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 Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

893 views 3 12
Read article

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