Incoming Mail: Unable to create issue with message
Problem
Incoming mail from a particular Mail Handler is not being created as issues. Users would notice that the message reaches the e-mail account and then moved. However, no issues are created in JIRA.
The following warning appears in the incoming-mail.log:
2016-01-16 00:58:56,820 WARN [jira_email_box] atlassian-scheduler-quartz1.clustered_Worker-4 ServiceRunner xxxx Email Handler xxxx Email Handler[10100]: Unable to create issue with message.
com.atlassian.jira.exception.CreateException: com.atlassian.jira.workflow.WorkflowException: An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@2b610fcb: root cause: java.lang.NullPointerException
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:648)
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssueObject(DefaultIssueManager.java:741)
at com.atlassian.jira.service.util.handler.DefaultMessageHandlerContext.createIssueWithIssueManager(DefaultMessageHandlerContext.java:261)
at com.atlassian.jira.service.util.handler.DefaultMessageHandlerContext.createIssue(DefaultMessageHandlerContext.java:154)
at com.atlassian.jira.service.services.mail.DelegatingMessageHandlerContext.createIssue(DelegatingMessageHandlerContext.java:48)
at com.atlassian.jira.plugins.mail.handlers.CreateIssueHandler.handleMessage(CreateIssueHandler.java:268)
at com.atlassian.jira.plugins.mail.handlers.CreateOrCommentHandler.handleMessage(CreateOrCommentHandler.java:133)
at com.atlassian.jira.service.services.mail.MailFetcherService$1.process(MailFetcherService.java:438)
at com.atlassian.jira.service.services.mail.MailFetcherService$MessageProviderImpl.getAndProcessMail(MailFetcherService.java:304)
at com.atlassian.jira.service.services.mail.MailFetcherService.runImpl(MailFetcherService.java:426)
at com.atlassian.jira.service.services.file.AbstractMessageHandlingService.run(AbstractMessageHandlingService.java:263)
at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:66)
at com.atlassian.jira.service.ServiceRunner.runService(ServiceRunner.java:75)
at com.atlassian.jira.service.ServiceRunner.runServiceId(ServiceRunner.java:53)
at com.atlassian.jira.service.ServiceRunner.runJob(ServiceRunner.java:36)
at com.atlassian.scheduler.core.JobLauncher.runJob(JobLauncher.java:135)
at com.atlassian.scheduler.core.JobLauncher.launchAndBuildResponse(JobLauncher.java:101)
at com.atlassian.scheduler.core.JobLauncher.launch(JobLauncher.java:80)
at com.atlassian.scheduler.quartz1.Quartz1Job.execute(Quartz1Job.java:32)
at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: com.atlassian.jira.workflow.WorkflowException: An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@2b610fcb: root cause: java.lang.NullPointerException
at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:909)
at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:635)
... 20 more
Caused by: com.opensymphony.workflow.WorkflowException: An unknown exception occured executing Validator com.atlassian.jira.workflow.SkippableValidator@2b610fcb: root cause: java.lang.NullPointerException
at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(AbstractWorkflow.java:1523)
at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1203)
at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:615)
at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:879)
... 21 more
Caused by: java.lang.NullPointerException
at com.googlecode.jsu.workflow.validator.FieldsRequiredValidator.validate(FieldsRequiredValidator.java:123)
at com.googlecode.jsu.workflow.validator.GenericValidator.validate(GenericValidator.java:75)
at com.atlassian.jira.workflow.SkippableValidator.validate(SkippableValidator.java:52)
at com.opensymphony.workflow.AbstractWorkflow.verifyInputs(AbstractWorkflow.java:1512)
... 24 more
Cause
The particular workflow has a validator which is not allowing the Incoming Mail to create issues, which means that there might be a required field on creation of the issue, however, due to the fact that this is not specified in the mail, therefore the issue is not created.
Resolution
Review the validator for the create issue transition and remove any required fields as using JIRA's native mail handlers it is not possible to specify other fields. I workaround would be to make the field required using the Field Configuration and then remove it from the workflow validator.