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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

How email handler work from Sciptrunner

I noticed there is an email handler option in script runner, but don't have any clue how it works, there isn't any clear documentation. Currently, we are using Jira email handler, whenever to receive an email it creates a ticket. We are using the email handler for Nagios alert, so Jira email creates a ticket with each alert. We would like to create a new ticket only if there will be a problem, but once you get a resolve email it should close the ticket and not create a new ticket or if the issue continues it should post an email in the comment of an existing ticket. 
I thought script runner might solve the problem but I didn't find the proper user guide, I might don't use the right keyword to search it. Can someone walk me through all process that how to use scriptrunner's email handler option? I really appreciate it.

1 answer

2 votes
Lasse Langhorn
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.
May 09, 2020

Hi @Shah Baloch

The Mailhandler that ships with the Scriptrunner app for Jira will process incoming emails and execute a Groovy script. What you put in the script is up to you but you have the option to do some great things. Examples could be:

  • Create a new Jira issue based on email message
  • Trigger workflow actions
  • Creating users based on email
  • Etc.

You can find the documentation for Scriptrunner Mailhandler here.

There is some great examples to get you started.


Lasse Langhorn

Thank you for your reply. The documentation is not much clear, maybe it's new for me that's why. I entered the first script mentioned in the documentation, it is saying I don't have any mail, I have emails in my inbox, I don't know why I get that message that shown in the screenshot. Why it is checking the server? I thought it'll pick up the email from the inbox. I appreciate your help.SR_Email_Handler.png

Like Stefan Salzl likes this

This can be close, I fixed the issue. Thanks

Hello @Shah Baloch


I would like to know how you unblocked yourself so if it is possible to show me your incoming mail.


Thank you.

It didn't work as we needed. It can create a ticket if an email received.  We wanted to use it for Nagios alert, However, it was creating duplicate tickets for the same type of alerts. Jira's email handler works better for us. I copied the code here Mail Handler


Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events