When a comment is added along with a status transition, comment notification is not sent

Sameera Shaakunthala [inactive]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2013

When performing a workflow transition in JIRA, optionally a comment can be added. In one of our projects, we have a multi user picker custom field called Management Notifications. Whenever a comment is added to an issue, users who are in this custom field must be emailed, but none of the other events.

What we have done is associating the 'Management Notifications' field to the 'Issue Commented' event in the notification scheme.

This setup does not work when a comment is added along with a status transition. Is there a workaround to fix this?

2 answers

3 votes
r
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2013

Hi,

the notification is not being send because while executing the status transition an associated event is fired, which is generally not the "issue commented" event. Please check the event fired in your transition (you can see it in the postfunctions of the transition) and associate the event with the multiuser picker custom field (assuming that you wish to notify users) in your notification scheme. Or, you can edit your workflow and set the issue commented event to be fired while executing the transition.

Hope this helps,

Rad

Sameera Shaakunthala [inactive]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 28, 2013

Hi,

Thank you for the answer.

In our requierment, once a transition is happended, there's a set of people to be notified.

Once a comment is added, there's another set of people to be notified. Thse people do not want to get too many e-mails flooded in their mailboxes, therefore only the commented event, nothing more.

Looks like the Issue Commented event is supressed by the Generic, Create, Close, etc. events. What I'm looking for the 'union' of these two event notifications, while managing to send only one e-mail per person.

In your suggestion, if we edit the workflow and set the Issue Commented event as the post function, Management Notifications will also be notified with status changes. In the other hand, it's the same as adding the custom field to Generic, Create, Close events without editing the workflow.

Regards,

Shaakunthala

0 votes
David Yu
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 12, 2019

This is one of those all or nothing settings that's a bit inflexible. For example, you want watchers to always be notified when a comment occurs in a transition, but not when the transition is missing a comment. What users probably end-up doing is erring on side of not-missing comments, and email regardless.

In the past, one could get by simply wrapping the event called. For example, fire an event "Transition Comment" via a ScriptListener (Scriptrunner). In your script check if comment is null, or not. If it is, fire a "Comment" event. Otherwise, fire an "Update" event.

This works fine but if you enable Batching in version 8+, this can cause some problems and may result in a duplicate comment appearing in the emails if you mention a person, and they are already a watcher (but due to a bug, this seems unavoidable anyway). Anyway, if they do fix the bug, I suspect you'll need to patch "FireIssueEventFunction.java" to intercept and fire the correct event, or turn off Batching.

Suggest an answer

Log in or Sign up to answer