Automating Jira Ticket Creation from Emails using MuleSoft

9/17/2025

Introduction

Emails are one of the most common ways customers and employees raise requests or report issues. However, managing issues over email can become messy, requests can be missed, updates get buried, and there is no central tracking.

On the other hand, Jira is a powerful issue-tracking platform widely used for support, IT helpdesk, and project management. The problem is: most support emails need to be manually converted into Jira tickets, which is time-consuming and error-prone.

This blog explains how to build a MuleSoft accelerator that automatically creates Jira tickets from incoming emails. It also uploads any attachments from the email (like documents or screenshots) into Jira, ensuring all information is captured in one place.

Objective

The main goals of this accelerator are:

1. Listen to an email inbox (e.g., support@company.com).
2. On receiving a new email, create a Jira ticket using the email subject and body.
3. Upload any attachments from the email into the Jira ticket.
4. Save time and ensure no request is missed.
By the end of this blog, you’ll have a working MuleSoft flow that integrates Email → Jira seamlessly.

STEP 1:  Setting up Email and Jira Access

EMAIL

Enable 2-Step Verification and Generate an App Password

1. Go to your Gmail account settings: https://myaccount.google.com/security

2. Enable 2-Step Verification if it's not already enabled.

3. After enabling it, generate a 16-digit App Password for use in third-party applications (as shown in the diagram below).

https://myaccount.google.com/apppasswords

Jira Setup

Step 1 Sign up for Jira Cloud

1. Go to https://www.atlassian.com/software/jira

2. Click Get it free.

3. Sign up using your work email address (or Google/Microsoft login).

4. Verify your email and log in to your new Jira Cloud account.

Step 2 Create a New Project

1. After logging in, go to the Jira dashboard.

2. Click on Projects → Create Project.

3. Choose a template (for our use case, Kanban or Service Management works well).

4. Enter details:
      --→ Project Name: MyProject

      --→ Project Key: KAN (auto-generated, you can edit if needed)
5. Click Create.

Now you’ll have a new Jira project where MuleSoft will create tickets.

Step 3 Create an API Token (for MuleSoft Integration)

1. Open https://id.atlassian.com/manage-profile/security/api-tokens.

2. Click Create API Token.

3. Give it a label (e.g., MuleSoft Integration).

4. Copy the generated token (you’ll only see it once).

5. Store it safely — this is what MuleSoft will use for authentication.

STEP 2 : Implementation

 Step 1 Email Connector Configuration (IMAP)

1. We will configure IMAP to listen to a support mailbox (e.g., support@company.com).

2. Drag and drop the “On New Email — IMAP” connector from the Mule Palette onto the canvas.

3. Add a new configuration named “Connector Configuration” by clicking on the “+” button and specify the folder name as INBOX so that the connector polls messages from this folder.

 4. In the General section of the connector, set the Frequency to 1 minute.

5. Configure the “On New Email — IMAP” connector with the following settings.

Connection: IMAPS Connection
Host: imap.gmail.com
Port: 993
User: <gmail account (mymailgmial.com)>
Password: <my application password>
Trust Store Configuration : Insecure

Step 2 Jira Connector Configuration

1. We will connect Mule to Jira Cloud using Basic Auth with API Token.

2. Drag and drop the “Create issue” connector from the Mule Palette onto the canvas.

3. Add a new configuration named “Connector Configuration” by clicking on the “+” button.

4. Configure the “jira” connector with the following settings.

Base URL: https://<your-domain>.atlassian.net
Username: Jira account email ID
Password: Jira API Token (generated in the above steps)

Main Flow – accelerator-mail2jira-apiFlow

1. IMAP Listener (On New Email) – Listens for new emails every 1 minute.

2. Logger (Start) – Logs the start of the flow.

3. Transform – Save Email Data – Saves email payload and attributes into variables.

4. Flow Ref → jira-issue-creation – Calls sub-flow to create a Jira issue.

5. Choice Router – Checks if the email has attachments.

6. jira-attachments Sub-flow – Called if attachments are present.

7. Move to Processed Folder – Moves email to "PROCESSED" folder after processing.

8. Logger (End) – Logs the end of the flow.

Sub-flow – jira-issue-creation

1. Logger (Start) – Logs the beginning of the Jira ticket creation process for monitoring and debugging purposes.

2. Transform – Create Issue Payload → Uses the create_issue.dwl script to generate the JSON structure needed by Jira, including fields like project key, summary, description, and issue type.
3. Try Scope – Create Jira Ticket → Attempts to create a Jira issue by using create issue operation. This step handles both success and failure paths.
4. On Success – If the Jira issue is created successfully, the response is saved into vars.issueResponse for future use or logging.
5. On Error – If something goes wrong during the Jira call, the email is moved to the FAILED folder and error details are captured in logs for troubleshooting.
6. Logger (End) – Marks the completion of the Jira issue creation flow, indicating whether the operation finished successfully or failed.

Sub-flow – jira-attachments


1. Logger (Start) – Logs the beginning of the attachment handling process to help with debugging and tracking.
2. Transform – Extract Attachments – Processes the incoming email to extract attachments and format each with details like filename and content (ready for upload).
3. For Each – Process Each Attachment – Iterates through each extracted attachment to handle them one by one:
  --→ Converts the content into a byte stream (application/octet-stream) suitable for Jira.
  --→ uploads the attachment to the Jira issue using the add attachments operation.

4. Error Handling – If any attachment fails to upload:
 --→ The error is logged for review.
 --→ The flow continues to process remaining attachments; the main ticket remains unaffected.

5. Logger (End) – Logs the end of the attachment processing flow to indicate all attempts to upload attachments have completed.

STEP 3: Testing

Once the configurations and flows are completed run the application and test it.

Scenario 1: Email without attachments

Expected Result:

A new Jira issue is created in the XXX project.
Summary = Email Subject (Login not working)
Description = Email Body
Email is moved to the PROCESSED folder.

Scenario 2: Email with attachments

Scenario 3: Invalid Jira configuration (Failure case)

Conclusion

The Mail-to-Jira Accelerator automates the process of converting support emails into Jira tickets, saving time and reducing manual errors. It ensures attachments are uploaded and emails are organized seamlessly. This makes support teams more efficient and responsive while improving overall ticket handling.