Adding your own email handling classes

JIRA Documentation

Index

In JIRA, emails may be periodically fetched (eg. via POP or IMAP) and processed (eg. create a new issue, create a comment). You can add new ways of processing emails by implementing the MessageHandler interface in JIRA (or subclassing one if its implementations).

MessageHandlers
For more information on MessageHandlers, including API documentation and source to the system handlers, see the documentation

After writing your MessageHandler implementation, this is how to get it into JIRA:

  1. Compile your handler and add it to the JIRA classpath (either as a JAR in WEB-INF/lib or as a class in WEB-INF/classes). JIRA Standalone has an external-source directory whose README describes a quick way to compile source (see JIRA Standalone quick source modifications).
  2. Add your handler to the services/com/atlassian/jira/service/services/pop/popservice.xml
  3. Restart JIRA

You should now be able to select your own MessageHandler when configuring a POP service.

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.
  1. Mar 01, 2005

    Mark Derricutt says:

    When a listener is triggered by comments created from a MessageHandler, can the ...

    When a listener is triggered by comments created from a MessageHandler, can the listener identify which handler, or service created it?

    A comment on the JIRA mailing list pointed me to walking the stacktrace to check on my own service being used, but a more generic manner would be usefull.

  2. Mar 20

    Matt Doar says:

    Of course, if your service is the IMAP service instead of POP, then you need to ...

    Of course, if your service is the IMAP service instead of POP, then you need to add your new handler to imapservice.xml not popservice.html.

    This document could do with making the relationship between services and handlers even more obvious since their names are a bit generic. Also, a better way of adding new handlers without having to edit the XML service file would be good. I know I could add a new service as a plugin component and then add a new service.xml file with that, but I'd like to reuse the IMAP service. This seems to me to be a weak area of JIRA plugins.