# Enhance Jira Service Management with Email This Issue

This tutorial explains how to enhance Jira Service Management with Email This Issue to process incoming emails or to send customer notifications.

## Use case <a href="#enhancejiraservicemanagementwithemailthisissue-usecase" id="enhancejiraservicemanagementwithemailthisissue-usecase"></a>

This tutorial covers the following use case:

1\. An external customer reports a ticket via email, a new issue is created from email, and a customer account is created automatically.

2\. A service management agent requests more information form the customer by commenting the issue, customer is notified.

3\. The customer replies to the email, the issue is commented, old content from the email is stripped out.

4\. The service management agent resolves and closes the issue, and the customer is notified.

## Before you begin <a href="#enhancejiraservicemanagementwithemailthisissue-step-by-stepguide" id="enhancejiraservicemanagementwithemailthisissue-step-by-stepguide"></a>

These must be configured to be able to implement the above use case:

* Mail handler
* Event notifications

## Procedure

### Preparing email templates for customer notifications <a href="#enhancejiraservicemanagementwithemailthisissue-prepareemailtemplatesforcustomernotifications" id="enhancejiraservicemanagementwithemailthisissue-prepareemailtemplatesforcustomernotifications"></a>

Email templates are needed only if you want to send emails to your customers.

1\. Go to **Email Templates** under **OUTGOING EMAILS**.

2\. Click **Add** to add one template from each of these Themes:

* Service Management Customer Invitation: If customers may be created automatically with Public Signup Enabled in Service Management .
* Service Management Request Participant Added Notification: if you want to notify participants when they are added.
* Service Management Auto Acknowledge: if you want to automatically acknowledge incoming emails.
* Service Management Request Created / Updated / Resolved / Public Comment Added: if you want to setup event notifications for Customers.

3\. Use the default template content. You can customize the templates any time later.

### Configuring a mail handler to process emails <a href="#enhancejiraservicemanagementwithemailthisissue-configuremailhandlertoprocessemails" id="enhancejiraservicemanagementwithemailthisissue-configuremailhandlertoprocessemails"></a>

1\. Go to **INCOMING MAILS** --> **Mail Handlers.**

2\. Add an IMAP or POP connection to an email account, e.g. `support@mycompany.com`

3\. Add a Mail Handler with the following parameters:

* Name: give a descriptive name, e.g. MyCompany Support Handler.
* Server: select the email account you configured above.
* Handler: select Email This Issue Mail Handler.
* Project: select the Service Management project in which you want to track your ticket, e.g Helpdesk.
* Issue Type: Select the type you want to use to represent a ticket, e.g. Request.
* Specify a default reporter: a user who has Create Issue and Add Comment permissions in the project
* Leave other settings with the default value.&#x20;

{% hint style="warning" %}
**Important**: Do not enable the **Create Users** option!
{% endhint %}

4\. Go to Jira **Administration** --> **Issues**, add a multi-user picker custom field, e.g. External Participant, and make sure the field is accessible in the project and issue type you configured above.

5\. Go to **INCOMING MAILS** --> **Mail Handlers** and click **Add** to add a Mail Handler Context. The attributes of the Mail Handler Context should be the following:

* Project: select the Service Management project you configured your mail handler.
* Issue Type: select the default  issue type you configured above (Request).
* Select the Email Processing Strategy: Service Management: Create or Comment Requests.
* Select the Customer Request Type to use. Request Types are dependent on the selected Issue Type.
* In "When Customers are Created", select the template based on theme "Service Management Customer Invitation" or leave it empty.
* In "When Participants are Added", select the template based on theme "Service Management Request Participant Added Notification" or leave it empty.
* In "Service Management Comment Visibility", select "Default Behaviour".
* In Acknowledge New Issues and Acknowledge New Comments, select the template based on theme "Service Management Auto Acknowledge" or leave it empty. This will make sure that email senders will get an instant feedback from your JIRA system, that their emails have been processed. The email will contain the issue key as a reference number.
* In User Recipients, select "Save to multi user picker field" and select the above created field.
* In Sender Field, select the "External Participants" field.&#x20;
* In Recipient Field and Copy Recipient Field, select "External Participants".
* Email Address Exclusion: enter the email address this Mail Handler is listening on (see step 2).
* In Split Regex, enter the following:

```
/From: |___.|On .wrote:|----Orig.|On .(JIRA)./
```

6\. Click **Save.**

{% hint style="success" %}
**Result**: You have now prepared Email This Issue to process incoming support emails.
{% endhint %}

Read more here:

[Mail Handlers](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/incoming-emails/next-generation-mail-handlers)&#x20;

[Service Management Integration](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/service-management-integration)

### Configuring Event Notifications <a href="#enhancejiraservicemanagementwithemailthisissue-configureeventnotifications" id="enhancejiraservicemanagementwithemailthisissue-configureeventnotifications"></a>

1\. Go to **OUTGOING EMAILS** --> **Notifications**.

2\. Click **Add** to create a new Notification Template, and give it a name. Make sure you select "All Matching Events" in the Event Processor field.

3\. On the Notification Events page click **Add** to add an Customer Notification events to notify Customers on. For each customer notification you need to specify the following:

* an email template you created above based on the appropriate themes
* recipients
* additional email content

4\. Click **Add** to add an Issue Event Notification to notify Agents or Collaborators on. For each issue event notification you need to specify the following:

* events as described in this tutorial. Read more [here](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/faq/tutorials/setting-up-customized-notifications).

5\. Click **Save**.

6\. Repeat the above steps to add all your events. Once you are completed, your Notifications should look something like this:

![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2FSKYaZtMvsXvesLwbfSP2%2Fimage.png?alt=media\&token=de3e83e7-f42b-4b2d-8dd5-db0aeac815f7)

7\. Go to **OUTGOING EMAILS** --> **Contexts** and click **Add** to add a new context with the following attributes:

* Project: select the project you configured your Context for (Helpdesk). You can leave the Project field empty to use this context for all projects.
* Issue Type: select the type you configured above (Request). You can leave issue type empty, to use this context for all issue types. Template: select the template you created above (Helpdesk template).
* Notification template: select the notification you created above (Helpdesk Notifications).
* External Watchers Field: select the field you created for your Mail Handler, called External Participants.
* Sender Name Pattern: enter a name that appears in the emails as the sender, you can leave it empty.
* From Email Address: enter the email address you created for your mail handler (<support@mycompany.com>).

After you're done, your Context should look something like this:

![](https://4173056255-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FY44m7ZY1jU4Arh2tzwNn%2Fuploads%2Fz5qU5Wc8sUyK34Jy9Nug%2Fimage.png?alt=media\&token=9a293b1a-1a37-4eec-8eaf-aa5dd3298d8b)

{% hint style="success" %}
**Result**: Your basic email support system is in place and is ready to serve you.
{% endhint %}

## Related articles

[Email Templates](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/outgoing-emails/email-templates)

[Event Notifications](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/outgoing-emails/event-notifications)

[Service Management Integration](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/service-management-integration)

[Contexts](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/documentation/outgoing-emails/contexts)

[FAQ](https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/faq/faq)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.meta-inf.hu/email-this-issue/email-this-issue-for-jira-server-data-center/faq/tutorials/enhance-jira-service-management-with-email-this-issue.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
