Mail Handler
What is the Mail Handler?
Mail Handler for ScriptRunner allows users to run Groovy scripts when a message is received, expanding on Jira's built-in mail-handling capabilities. The Mail Handler processes incoming mail, automates tasks, creates users from the recipient list, or triggers workflow actions.
How to use a Mail Handler
You may want to configure a mail handler to:
- Create a new issue from the mail subject.
- Create users from the recipient list.
- Transition an issue based on the email content.
Before you start
See our Introduction to Scripting in ScriptRunner training module to learn about scripting. |
Broaden your horizons by exploring Mail Handler script examples. |
Add an Incoming Mail Handler
Configuring a Mail Handler
The ScriptRunner Mail Handler provides the following binding variables:
message- The email message the handler is going to handle.messageis an instance of javax.mail.Message.messageHandlerContext- Jira utility class which helps to create issues, comments, and attachments etc.nonQuotedMessageBody- A non-quoted message body contains lines that do not start with a '>' or '|'.
Tip: For help writing mail handler scripts, and details of utility methods, such as retrieving senders, body, and attachments from messages, see Atlassian MailUtils.