Stopping Double Notifications for JIRA users
This is a frequently asked question, I paste a response here to save re-stating this in future!
Scenario
Stopping Double notification to JIRA users in all situations is hard when you have both Email only and interactive JIRA users creating issues in the same project, both interactively and through email:
Email Only user notifications
JEMH Event Listener needs to be currently configured for the Post-event in order to notify users on creation (at all) and then also enables rendered in-line images that were also attached.
JIRA user notifications
In order to notify Watchers and other users who may be set in MultiUserPicker custom fields that were derived from other JIRA-registered recipients of the original email, JEMH Event Listener needs to be configured for the Post-create event OR the Profile needs to drive issue creation notifications. The Problem with using JEMH Profile > Notifications is that this notification will duplicate the typical JIRA response to ISSUE_CREATED (two notifications). The Problem with using JEMH Event Listener for JIRA user notifications is that if its Post-create event is used, whilst interactive users get the 'right' output from ISSUE_CREATED, when JIRA users mail into JEMH, both the ISSUE_CREATED and the Post-create fire, delivering twice.
What's needed is a way to defeat the standard ISSUE_CREATED notification in JEMH when JIRA users send email in.
Coming soon (but alas still no solution)
JEMH-280, a long running historic issue relating to how JEMH creates issues, which stops custom fields (like email only user custom fields) being available during ISSUE_CREATED EventListener and PostFunction processing, is due for fixing (well, its already fixed, but is such a big change its only being released as 1.7.x). Whilst this is great from some perspectives, and will solve post-function access to custom fields, and most users needs regarding issue-created, there are still fields that can't be set that way, so there will still be a need for the Post-create event (specifically, I'm talking about watchers and attachments)
Future Options
Defeating ISSUE_CREATED when the issue is being created by email is what’s needed, as that’s the scenario I see causing the duplication. Detecting that an issue was created by email could be achievable after JEMH-280 is fixed, because then, you could detect a default custom field set by JEMH (createdByEmail) with a default value set by JEMH for example. Labels can't be checked for now because labels are set during phase 2. Therefore once JEMH 1.7 is out, I will be able to add a$jemhNotificationManager.stopNotification() or similar that will defeat the notification.
This isn’t a perfect solution! There really isn't anything I can currently do about the duplication for JIRA users when they are also creating issues interactively AND you want to have inline images for issue creation. For now, I think this boils down to a choice what's most desirable now:
no duplication
or, in-line images and watcher/use-picker driven notifications