My Regexp Field Processor config is not being applied to all mails - what to do

Step 1 - Ensure REgexp Field Processor is applied

When things don't work, you may see the Basic Field Processor being used, this usually means there is a difference between your Configured from: address, and the email from: address.  

To fix this, you can either

  • edit the Email in the TestCase editor and set the from: address to be something appropriate

  • or you can make the Configured from address (of course) a regexp, so .* would match all senders.  

In both cases, creating Test Cases is the best thing to do, to prove the configuration.

Test cases

1. Create a test case, run it against your profile

2. Confirm that the Field Processor reported as handling the email is the Regexp Field Processor.

When you have the Regexp Field Processor reliably reported as handling the email, its time to look closer at the email content.

Email Content

Regexp Field Processor works over the extracted body content of an email.  If text/plain mail is sent in, this is easier to visualise and apply regexps to, but when HTML mail is concerned the content must undergo a HTML to TEXT transformation before the Regexp can work on it.

To determine the actual content that is supplied to the Regexp Field Processor do the following:

  1. Make a copy of your Profile (an option in the Profiles list)

  2. Delete additional Field Processors from the copied Profile, leave only the Basic Field Processor

  3. Run your Test Case against this Profile

  4. Check the body of the created issue, by editing it and copying (JIRA does some interesting whitespace reductions for presentation).  This 'content' is what the Regexp Field Processor will be presented with to process (you can actually then paste this 'test' content into the Regexp Field Processor self-test content field).

HTML Element Tag Handling

Despite looking the same, HTML converted content may not be exaclty the same, being made up of different HTML elements.  JEMH can be configured to process these elements in different ways, specifically to inject newlines (or not).  Its very much trial and error, too many new lines, and that content format may be broken up, too little and the content will run together on a single line.

Factors that affect content extraction

Current JEMH versions have a Email > PreProcessing field > Body Format Preference.  This allows JEMH to be configured to look for Text or HTML by preference.  If Text or 'Any Content' is used, the first text/plain part will be used.  Sometimes this can be empty.  The choice of format preference is very much dependant on the sources involved.

 

If the self-test doesn't work, likely, a real email wont work either. Repeating the content generation step above should allow a comparison against one set of test content versus another, which informs what needs to be done (whitespace changes, fix typos in the mail even).

 

If this doesn't work for you , please raise a support ticket https://thepluginpeople.atlassian.net/browse/JEMH.