3

I'm looking for a way to control the way the "Creating Issues and Comments from Email" works. At the moment since we are using the built in system any received email that has no subject cause the service to fail with the message "Issue must have a summary. The mail message has an empty or no subject.". Every time this happens we have to process the email manually.

Do you know of any way around this?

EDIT

The emails are being sent by customers, so I can't enforce all of them to send a subject.

The problem is that the mail creation service won't process the email once it has no subject.. so setting default value won't help. The only way i can think of is rewriting the mail service. Does anyone knows how could i do that? i I found the original source code here, but not sure how to build and deploy it.

Anyway can think of any other way?

Thanks!!

Kuf
  • 17,318
  • 6
  • 67
  • 91
  • 1
    The code you link to simply defers to `CreateIssueHandler` if it cannot find an existing issue. Maybe link to https://confluence.atlassian.com/download/attachments/267257008/CreateIssueHandler.java?version=1&modificationDate=1270682592592 instead, or as well. – tripleee Aug 21 '12 at 14:32
  • How does Jira receive the incoming messages? Are they delivered by something like Procmail to a local spool file, or does Jira download them from somewhere? – tripleee Aug 21 '12 at 16:37
  • I'm using the [create issue from email service](https://confluence.atlassian.com/display/JIRA/Creating+Issues+and+Comments+from+Email), mails are pulled from a pop mailbox. – Kuf Aug 22 '12 at 09:49
  • If you have login access on the POP server, you could just modify the messages before Jira gets them. – tripleee Aug 22 '12 at 12:38
  • I prefer not to do it on the mail server side since we might change the mail server. I much prefer doing it from within Jira. – Kuf Aug 22 '12 at 12:43
  • Add a dummy value to the Subject field. Or even an empty string? – mdoar Jul 16 '12 at 18:29
  • The emails are being sent by customers, so I can't enforce all of them to send a subject, not even an empty string. The problem is that the mail creation service won't process the email once it has no subject.. so setting default value won't help. – Kuf Jul 18 '12 at 06:29

1 Answers1

3

I assume that you just added some service to Jira in admin interface which automatically serializes emails.

If you want to fully customize the default behaviour, you can write your own simple jira plugin. See the Atlassian pages:

https://developer.atlassian.com/display/DOCS/Set+up+the+Atlassian+Plugin+SDK+and+Build+a+Project

https://developer.atlassian.com/display/JIRADEV/Component+Plugin+Module

Your atlassian-plugin.xml should include something like:

<component key="message-handler-factory" class="com.atlassian.jira.plugins.mail.internal.DefaultMessageHandlerFactory" public="true">
    <interface>com.atlassian.jira.service.util.handler.MessageHandlerFactory</interface>
</component>

You can for example extend the CreateOrCommentHandler class.

Peter Csiba
  • 461
  • 2
  • 10
  • I still haven't had the time to go trough it all but it sure looks promising, so I guess that since there are less than 24h to the end of the bounty, u deserve it, Thanks for your help !! – Kuf Aug 22 '12 at 14:48
  • You are welcome. If some problems occur don't hesitate to ask. – Peter Csiba Aug 27 '12 at 10:59
  • Actually that was all we needed, manages to make it work, thanks again! :) +1 – Kuf Aug 27 '12 at 11:00