We want to stop Email notification for Issue update event for Issue with Closed status.

As I have analyzed through Atlassian community, it looks like I have to hack the core code of issue updated listener. Is it like should i create a listener and check whether the event is issue updated and then the issue status and then flag off notification? If yes, how to flag off notification via code. Please input

or, Is it I have to edit the core JIRA code, then Can you help me where to add that if condition ?

2 answers

1 accepted

1 vote
Accepted answer

At a high level, this is pretty straightforward:

  • Remove the notification from your notification scheme(s) for "Issue Updated".
  • Create a custom event "Closed Issue Updated".
  • Add a custom listener via Script Runner that listens for the "Issue Updated" event, and emits "Closed Issue Updated", with a simple condition based on the Issue Status.  Emitting events is a pre-built listener, and the condition should be simply (issue.getIssueStatus().getName()=="Closed") (there may be a built-in status-based example as well, I didn't check).  I'd make it for all projects, since the event is generically applicable.
  • Add the appropriate "Closed Issue Updated" notification to your notification scheme(s).

This approach is fairly non-intrusive; from the listener side, you are basically just adding a conditional event, and each project admin can choose to notify on it, or not, as is appropriate.

Actually, it looks like you wanted "Open Issue Updated".  If it was me, I'd create both events and two listeners, so you have complete flexibility (an admin may want to see the closed updates).  Just invert the logic of the condition for the "Open" event.

 

Creating a new listener may not help you, because unless you remove the notification scheme from the project, JIRA will dend event notifications. If you remove, issue updated event grom the scheme, your listener will have to implement the update notification as you described. There may be several addons that support what you need, one of them is email this issue: https://marketplace.atlassian.com/plugins/com.metainf.jira.plugin.emailissue/server/overview

Beside many other things, It has support for conditional notifications out of the box.

@Tibor Hegyi [META-INF] : As our requirement is only this, I am not fully agreeing in buying an addon. I believe we can develop a plugin for this specific requirement. I wanted to know, If I have configured issue update notification, is there any ways in writing a listener and setting notification off for that particular issue based on defined conditions ?

 

Like issueeventdispatcher -> setnotification false. Will it have any effect ? I want to know before I put effort.

 

Thank you for you inputs. If you can help, I would be more happy smile

No, JIRA is going to pick up the "issue updated" event and fire a notification whatever you do.

You do not need to hack the core code, but you do need a new listener or something like the add-on Tibor mentions.

Without the addon, you will need to find/write a listener that sends an email when it detects "issue updated".  JIRA's notification stuff works like that already, but the bit you need to add is "unless status is closed".

Once you have that working, or you've used the suggested add-on, you then change your notification scheme so that it sends mail to nobody on the issue updated event (because the listener or add-on will be sending a duplicate)

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Friday in Jira Service Desk

Looking for anyone who has switched from Zendesk to Jira Service Desk

Hi Community! The Jira Service Desk marketing team is looking for customers who have successfully switched from Zendesk to Jira Service Desk!   We’d love to hear your thoughts on the pros and ...

154 views 8 3
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