We're using a scripted listener to send a custom email on an event that's triggered by a workflow post-function. The problem is that sometimes, users get duplicate notifications, and it's unclear why. Here's what happens.
- The issue is created through a mail handler with JEMH. The CC users are set as Watchers, as well as members of two other user custom fields.
- The custom Created event triggers the custom email listener, who sends the email to the Reporter and Assignee, and cc to the watchers and the members of the other 2 custom fields.
- The users will receive up to 3 identical emails sent simultaneously by the scripted listener
I suspected this had something to do with the custom fields notified in cc, but it doesn't really make sense, because all extra mails are sent to the same users in TO and CC, exactly as if the listener runs several times. However, I could see that the event was only sent once, and that the outgoing email log doesn't report any timeout errors that could explain this (https://confluence.atlassian.com/jirakb/read-timed-out-error-when-sending-outbound-mail-from-jira-applications-240193685.html)
To make matters worst, it seems to be intermittent, with only some of the tickets in this project being affected. It also occurs on other events, like Issue Resolved.
We have other similar listeners enabled on other projects, but this behaviour can't be reproduced apart from this one project.
Anybody has an idea on what it could be?
We're running jira server 6.3.10 with ScriptRunner 3.1.4