Email Notifications based on If-Then Statements

Is there an option within JIRA 4.2.4 to configure email notifications with if-then statements in addition to a specific event?

For example,

event = issue assigned

'if (reporter = john) and (assignee = joe) then notify jane'

2 answers

You have to override standart Jira notification system by custom issue listener with injected or dinamically obtained (ComponentAccessor.getMailQueue()) component MailQueue.

With this component you can add MailQueueItem objects in standart mail queue as standart notifications did.

it works like that :

final Email email = createEmail(); //create email object in your code here
        AbstractMailQueueItem item = new AbstractMailQueueItem(email.getSubject()) {

            private final Logger log = Logger.getLogger(AttachmentusListener.class);

            public void send() throws MailException
                SMTPMailServer smtpMailServer = MailFactory.getServerManager().getDefaultSMTPMailServer();
                if (!MailFactory.isSendingDisabled())
                    if (mailThreader != null) mailThreader.threadEmail(email);
                    if (mailThreader != null) mailThreader.storeSentEmail(email);

And you have to manually fill VelocityManager context for generating email body. Here you can use default template path but it is tricky to mimic default notifications velocity context and I recommend use custom email templates.

0 vote
Renjith Pillai Community Champion Jul 28, 2012

You seem to be on OnDemand and I am afraid that such customizations are not supported there. Otherwise Jamie's script plugin could probably let you achieve your requirement.

Suggest an answer

Log in or Join to answer
Community showcase
Louis De Jaeger
Posted yesterday in Off-topic

Friday fun: your best joke

Hi all Lets make this Friday fun really fun and post one (or more) of your best jokes! The joke can be about an Atlassian product, or just a really fun joke you want to share! I’m not the best j...

168 views 12 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot