Reader small image

You're reading from  JIRA 7 Essentials - Fourth Edition

Product typeBook
Published inNov 2016
Reading LevelBeginner
PublisherPackt
ISBN-139781786462510
Edition4th Edition
Languages
Tools
Right arrow
Author (1)
Patrick Li
Patrick Li
author image
Patrick Li

Patrick Li is the cofounder of AppFusions and works as a senior engineer there, specializing in integration solutions with many enterprise applications and platforms, including IBM Connections, Jive, Google Apps, and more. He has worked in the Atlassian ecosystem for over 10 years, developing products and solutions for the Atlassian platform and providing expert consulting services. He has authored many books and video courses covering Jira. He has extensive experience in designing and deploying Atlassian solutions from the ground up and customizing existing deployments for clients across verticals such as healthcare, software engineering, financial services, and government agencies.
Read more about Patrick Li

Right arrow

Chapter 8. E-mails and Notifications

So far, you have learned how to use and interact with JIRA directly from its web interface through a browser. However, you are not restricted only to a web browser; you can also communicate with JIRA through e-mails.

One powerful feature of JIRA is its ability to update users on their issues' progress through e-mails, and also create and comment on issues based on e-mails sent from users. This provides you with a whole new option of how you and your users can interact with JIRA. By the end of this chapter, you will have learned the following:

  • How to set up a mail server in JIRA

  • Events and how they are related to notifications

  • How to configure JIRA to send out notifications based on events

  • How to create custom mail templates

  • What a mail handler is

  • How to create issues and comments by sending e-mails to JIRA

JIRA and e-mail


E-mails have become one of the most important communication tools in today's world. Businesses and individuals rely on e-mails to send and receive information around the world almost instantly. Therefore, it comes as no surprise that JIRA is fully equipped and integrated with e-mail support.

JIRA's e-mail support comes in several flavors. Firstly, JIRA e-mails users about changes made to their issues, so people working on the same issue can be kept on the same page. Secondly, JIRA can also poll mailboxes for e-mails and create issues and comments based on their content. The last feature is the ability for users to create and subscribe to filters to set up feeds in JIRA (we will discuss filters in Chapter 10Searching, Reporting, and Analysis). These features open up a whole new dimension on how users can interact with JIRA.

In the following sections, we will look at what you need to do to enable JIRA's powerful e-mail support and also explore the tools and options at your...

Mail servers


In order for JIRA to communicate with e-mails, you need to configure or register your mail servers in JIRA. There are two types of mail servers you need to configure:

  • Outgoing: This is used by JIRA to send e-mails out to users. JIRA supports SMTP mail servers.

  • Incoming: This is used by JIRA to retrieve e-mails from users. JIRA supports POP or IMAP servers.

We will start with outgoing mail servers first to see how we can configure JIRA to send e-mails to users as well as customize the e-mail contents.

Working with outgoing mail


Like many settings in JIRA, you need to be a JIRA system administrator (the user created during the initial setup is a system administrator) to configure mail server details. Perform the following steps to manage the outgoing mail server:

  1. Log in to JIRA as a JIRA administrator.

  2. Browse to the JIRA administration console.

  3. Select the System tab and then the Outgoing Mail option. This will bring up the Outgoing Mail page:

Note

You can have only one outgoing mail server in JIRA.

Adding an outgoing mail server

There are two ways of adding an outgoing mail server in JIRA; both options have some common configuration parameters that you will need to fill in. The following table shows these parameters:

Mail queues


E-mails in JIRA are not sent immediately when an operation is performed. Instead, they are placed in a mail queue, which JIRA empties periodically (every minute). This is very similar to the real-life scenario, where e-mails are placed in mailboxes and picked up every day.

Viewing the mail queue

Normally, you do not need to manage the mail queue. JIRA automatically places e-mails into the queue and flushes them periodically. However, as an administrator, there may be times when you wish to inspect the mail queue, especially to troubleshoot problems related to JIRA notification e-mails. Sometimes, e-mails can get stuck for a number of reasons and inspecting the mail queue will help you identify the problems and fix them.

Perform the following steps to view the content of the mail queue:

  1. Browse to the JIRA administration console.

  2. Select the System tab and then the Mail queue option.

This page provides you with a one-page view of the current e-mails in the queue waiting for delivery...

Manually sending e-mails


Sometimes, you, as the administrator, may need to send out e-mails containing important messages to a wide audience. For example, if you are planning some maintenance work that will take JIRA offline for an extended period of time, you may want to send an e-mail to all JIRA users to let them know of the outage.

JIRA has a built-in facility, where you can manually send out e-mails to specific groups of users. There are two options when manually sending e-mails—you can either send them based on groups or by projects.

When sending by groups, all you have to do is select one or more groups in JIRA, and all users that belong to the selected groups will receive the e-mail. Users belonging to more than one group will not get duplicated e-mails.

When sending e-mails by projects, you have to first select one or more projects and then the project roles. We will discuss project roles in more detail in the next chapter; for now, you can think of them as groups of users within projects...

Events


JIRA is an event-driven system. This means that usually when an action occurs (for example, when an issue is created), JIRA fires off a corresponding event. This event is then picked up by components that are designed to listen to the event. Not surprisingly, they are called listeners. When a listener picks up an event, it will perform its duty such as keeping issues up-to-date with changes or sending an e-mail to users watching the issue.

This mechanism allows JIRA to process operations asynchronously. The advantage of this model is operations, such as sending e-mails, and it's separated from JIRA's core functions such as issue creation. If there is a problem with the mail server, for example, you will not want this problem to prevent your users from creating issues.

There are two types of events in JIRA:

  • System events: These are internal events used by JIRA, and they usually represent the main functionalities in JIRA. They cannot be added, edited, or deleted.

  • Custom events: These...

Notifications


Notifications associate events (both system and custom) to e-mail recipients. When an event is fired and picked up, e-mails will be sent out. Notification types define recipients of e-mails. For example, you can set them to only send e-mails to a specific user or all members from a given user group. You can add multiple notifications to a given event.

JIRA ships with a comprehensive list of notification types (that is, the recipients) that will cover many of your needs. The following table lists all the notification types available and how they work:

Field

Description

Name

This specifies a name for the mail server.

Description

This specifies a brief description for the mail server.

From address

This specifies an e-mail address that outgoing e-mails will appear to have come from.

Email prefix

This specifies...

The notification scheme


The notification scheme is a reusable entity that links events with notifications. In other words, it contains the associations between events and their respective e-mail recipients:

  1. Browse to the JIRA administration console.

  2. Select the Issues tab and then the Notification schemes option. This will bring up the Notification Schemes page:

From this screen, you can see a list of all the notification schemes and the projects that are currently using them.

JIRA comes with a generic default notification scheme. The default scheme is set up with notifications set for all the system events. This allows you to quickly enable notifications in JIRA. The default setup has the following notifications:

  • Current Assignee

  • Reporter

  • All Watchers

You can modify the default notification scheme to add your own notification rules, but as you grow your JIRA adoption, it is a better idea to create a new scheme from scratch or copy the default scheme and make your modifications.

Adding a notification...

Troubleshooting notifications


Often, when people do not receive notifications from JIRA, it can be difficult and frustrating to find the cause. The two most common causes for notification-related problems are either outgoing mail server connectivity or misconfiguration of the notification scheme.

Troubleshooting outgoing mail server problems is quite simple. All you have to do is try to send out a test e-mail as described in the Sending a test mail section. If you receive your test e-mail, then there will be no problems with your outgoing mail server configuration and you can focus on your notification configurations.

Troubleshooting notifications are not as straightforward, since there are a number of things that you will need to consider. To help with this challenge, JIRA 5 has introduced a new feature called Notification Helper. The notification helper can save the JIRA administrators time by helping them to pinpoint why a given user does or does not receive notifications.

All the administrator...

Incoming e-mails


We have seen how you can configure JIRA to send e-mails to notify users about updates on their issues. Although, this is only half of the story when it comes to JIRA's e-mail support.

You can also set up JIRA for it to periodically poll mailboxes for e-mails and create issues based on the e-mails' subject and content. This is a very powerful feature with the following benefits:

  • It hides the complexity of JIRA from business users, so they can log issues more efficiently and leave the complexity to the IT team

  • It allows users to create issues even if JIRA can only be accessed within the internal network. Users can send e-mails to a dedicated mailbox for JIRA to poll

Adding an incoming mail server

For JIRA to retrieve e-mails and create issues from them, you need to add the POP/IMAP mail server configurations to JIRA. POP and IMAP are mail protocols used to retrieve e-mails from the server. E-mail clients, such as Microsoft Outlook, use one of these protocols to retrieve your e...

The HR project


Users will often want to get progress updates on their issues after they have logged them. So, instead of business users having to ask for updates, we will proactively update them through our newly acquired knowledge, that is, JIRA notifications.

In Chapter 5Field Management, we added a custom field called Direct Manager, which allows users to add the manager of the new employee or leaving employee, so she can be kept in the loop.

The other customization we made in Chapter 7Workflow and Business Process, is the addition of new transitions in the workflow. We need to make sure that those transitions fire appropriate events and also send out notifications. In summary, we need to do the following:

  • Send out notifications for the events fired by our custom workflow transitions

  • Send out notifications to users specified in our Direct Manager custom field

While you can achieve both using other JIRA features, such as adding users as watchers to the issue and reusing existing JIRA system...

Summary


In this chapter, we looked at how JIRA can stay in touch with its users through e-mails. Indeed, with today's new gadgets, such as smartphones and tablets, being able to keep users updated with e-mails is a powerful feature, and JIRA has a very flexible structure in place to define the rules on who will receive notifications.

We also very briefly mentioned some of the security rules about who can receive notifications. JIRA performs security checks prior to sending out notifications for two very good reasons: first, there is no point sending out an e-mail to a user who cannot view the issue; second, you will not want unauthorized users to view the issue and receive updates that they will not know about.

In the next chapter, we will look into the security aspects of JIRA and how you can secure your data to prevent unauthorized access.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
JIRA 7 Essentials - Fourth Edition
Published in: Nov 2016Publisher: PacktISBN-13: 9781786462510
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Patrick Li

Patrick Li is the cofounder of AppFusions and works as a senior engineer there, specializing in integration solutions with many enterprise applications and platforms, including IBM Connections, Jive, Google Apps, and more. He has worked in the Atlassian ecosystem for over 10 years, developing products and solutions for the Atlassian platform and providing expert consulting services. He has authored many books and video courses covering Jira. He has extensive experience in designing and deploying Atlassian solutions from the ground up and customizing existing deployments for clients across verticals such as healthcare, software engineering, financial services, and government agencies.
Read more about Patrick Li

Notification type

Description

Current Assignee

This is the current assignee of the issue.

Reporter

This is the reporter of the issue (usually the person who originally created the issue).

Current User

This is the user who fired the event.

Project Lead

This is the lead of the project the issue belongs to.

Component Lead

This is the lead of the component the issue belongs to.

Single User

This states that...