I'm using Jira Data Center and am trying to setup a Mail Handler with ScriptRunner. My specific need is to allow the Mail Handler to process HTML files.
The problem I'm having is that when I click Run Now on the second page of the Mail Handler setup (same page where you enter the script), I get a message "Server Error An error occurred. Please review server logs".
I've setup the Mail Handler with the following settings. I had more in the script but deleted most of it to try and get pas the Server Error message, but even one import line causes the error.:
I have an email.txt file in the /data/shira/sharedhome/import/mail folder.
(First Window)
Name: Test
Server: Local Files
Delay: 10
Handler: ScriptRunner Mail Handler
Folder Name: Blank
(Second Window)
Catch Email: <email address of the sender>
Forward Email: <my email address>
Strip Quotes: <unchecked>
Create Users: <unchecked>
Script:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.exception.CreateException
import com.atlassian.jira.service.util.ServiceUtils
import com.atlassian.jira.service.util.handler.MessageHandlerContext
import com.atlassian.jira.service.util.handler.MessageUserProcessor
import com.atlassian.jira.user.ApplicationUser
import com.atlassian.jira.user.util.UserManager
import com.atlassian.mail.MailUtils
import javax.mail.Message
import javax.mail.internet.InternetAddress
Question: What is the easiest way to Setup a ScriptRunner mail handler and test that it is working? If there are errors, which error log would the be in? The script is not working, but I'm struggling to figure out how to debug with the the ScriptRunner Mail Handler environment. Any help would be much appreciated.