Use Regexp Field Processor
- 1 Introduction
- 2 Configuration
- 2.1 Editing Configurations
- 2.1.1 Config
- 2.1.2 Issue Association
- 2.1.2.1 Creating a simple Value via Regexp
- 2.1.2.2 Creating a compound value via Value Script
- 2.1.2.3 Script Type options Since 3.3.46
- 2.1.2.4 Example Velocity Script
- 2.1.2.5 Script value preview
- 2.1.2.6 Example ECMAScript Since 3.3.46
- 2.1.2.7 Script console and preview
- 2.1.3 Test Case
- 2.1.3.1 Adding a Test Case
- 2.2 Field Mappings
- 2.2.1 Multi-value support
- 2.2.2 Testing
- 2.3 Issue creation
- 2.4 Association with existing issues
- 2.5 Setting comment/description to extracted value only
- 2.1 Editing Configurations
- 3 Related articles
Introduction
The Regexp Field Processor uses Regular Expressions (commonly known as "regexps") to extract values from email content. Issue fields are mapped to these values. In addition, the field processor can be used to associate emails to an existing issue by finding a common regexp-extracted field value.
It is primarily designed for processing emails that have predictable content. A common source for such emails is an automated system such as Bugzilla.
It is recommended to have at least a basic understanding of how Regular Expressions work before attempting to configure this field processor. Useful references can be found from Wikipedia, and this online tutorial.
Just need issue association?
If you just want to create comments from email replies to notifications, then this field processor is not needed. By default, JEMH will use issue keys found in the Subject (the pattern used to search for issue keys can be modified via the Profile>Email>Subject IssueKey (comment) Regexps setting.
The Regexp Field Processor can provide the same behaviour with a 'custom field' of 'issueKey' and the appropriate regular expression.
Just Need Field mappings?
By default the Regex Field Processor will attempt to associate issues by matching a specific Regexp pattern within the Subject. If you do not need this then you can do the following to stop the Regex Field Processor from associating issues. These configuration options are found within Profile > Regex Configuration > Issue Association
Remove the Default Regex from Value Regexp
Remove the Value from Expected Match Value
Configuration
In the target JEMH profile, ensure that Directive processing is enabled by going to Profile>Directives. Then, enable the Regexp Field Processor under Profile>Field Processors:
Once enabled, you should see the Regexp Field Processor section listed at the bottom of the main profile screen. When the Regexp Field Processor is enabled, an example configuration is added: