Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to send mail to All Recipients in a same mail on Jira issue create/update/comment

srujan reddy March 5, 2012

Hi,

In my company, we migrated recently from Bugzilla to Jira and most of issues are assigned to email alias(eg: tools-team, qa-team, etc.) and also added email alias in watchers-list. Due to alias user accounts, we are receiving email duplication. So, I would like to send all recipients in one mail to reduce email duplication spam.
eg: sreddy, qa-team gets two emails.

To send All Recipients in a same mail on issue create/update/comment, which file do i need to modify in Jira source?

Thanks in advance!!

9 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
srujan reddy March 9, 2012

This information may be useful to ohers. I figured it out, how to send maill to All recipients in same mail. To send all of them in same mail we need modify the existing code in MailListener.java will fix the problem.

-Srujan

Andy Brook [Plugin People]
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.
November 29, 2012

Well yes, of course you can customize JIRA but that is not something many people do, it will have repeated costs associated with maintaining the. M changes. My previous comments related to confiuguration of the product...

0 votes
Build Monkey December 10, 2012

ok. I have the code, but I don't see in the code where to make the CC list visible.

Build Monkey December 15, 2012

Does anyone know what I need to change in MailListener.java to show the CC list?

Build Monkey December 15, 2012

Also, I downloaded the source for the version we have installed, 5.2.1 and used -classpath pointingto the compiled version. It looks like there are a lot of classes missing.

For example

com.atlassian.jira.component.ComponentAccessor

com.atlassian.jira.event.issue.AbstractIssueEventListener

is the source we get different than the compiled source we get when we install using .bin? I just need to modify this one file.

Andy Brook [Plugin People]
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.
December 15, 2012

I've no idea what you're trying to do, the sourcecode is intact, look again, perhaps you're not taking account of the project modularisation of the source bundle?

$ cd atlassian-jira-5.2-source/

$ find . -name ComponentAccessor.java

./jira-project/jira-components/jira-api/src/main/java/com/atlassian/jira/component/ComponentAccessor.java

0 votes
srujan reddy December 2, 2012

We are running currently on v5.1 and you need modify the code in following method.

protected void addMailItems(List<SchemeEntity> schemeEntities, IssueEvent event) throws GenericEntityException
{
.

.

.

}

Source file location:

atlassian-jira-5.1-source\jira-project\jira-components\jira-core\src\main\java\com\atlassian\jira\event\listeners\mail\MailListener.java

**NOTE: By modifying MailListener.java will breaks the email format(HTML/Text), either you can send only Text format or HTML format.

Andy Brook [Plugin People]
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.
December 8, 2012

ATlassian dont expose raw source code on a web server like that, it is accessible through https://my.atlassian.com, next to your relavent product license.

0 votes
Build Monkey December 1, 2012

I see the version of MailListener.java for v 3.1.3.3. I am using 5.2.1 and can't find an earlier version of the java file. Can someone point me to this and where in the code I would need to change to show the CC list.

Thanks!

0 votes
Build Monkey November 14, 2012

I don't see MailListener.java only MailListener.class

Where do I get the .java class.

srujan reddy November 15, 2012

You have download the Jira source code from my.atlassian.com. https://my.atlassian.com/login/index.

0 votes
srujan reddy November 14, 2012

You have to modify the MailListener.java file to show CC list.

0 votes
Build Monkey November 14, 2012

We are noticing that the emails do not contain other addresses in the CC line. My users would like to know who received the emails. Is it possible to do this or do I have change the MailListener.java file as well?

0 votes
MatthewC
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.
March 5, 2012

I'd agree with Andy, it would be a lot easier to modify your notification schemes & your local configuration than deep diving into the Jira source. The root of the problem is that only your mail server knows who is on a distribution list so Jira can't de-dupe it.

The easiest way is to replicate the distribution lists as groups in Jira (assuming every member of the distribution list is a user of Jira), that way Jira can de-dupe the list.

If not, then the end users have to accept that if they want to belong to so many distribution groups, they will get lots of emails!

The only other option I can think of would be to modify the email templates to include some kind of marker in the subject line which could be used by email client filters but that depends on every user setting up their own rules so not an ideal solution.

srujan reddy March 5, 2012

Thanks Andy and Mattew for the quick response.

Mattew,

Jira does not allow to assign issues to groups and also we can not add groups in Watcherlist. Is there anyway(plugin or configuration settings) to do this?

Thanks in advance!!

0 votes
Andy Brook [Plugin People]
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.
March 5, 2012

if there is a sender, and a cc: which is a notification group, then the sender will become the reporter, and will receive updates. If that users is part of the distribution group, JIRA has no way of knowing, it doesnt know its a distribution group. There is no file to modify, I don't believe you can fix that behaviour, happy to stand corrected.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events