...
Div | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||
|
...
- In JIRA, click the gear icon, and then click Applications.
- Under Integrations, click SmartHandler, and then click the handler in the list.
Click the Data Points tab, and then do one of the following:
- To create a new data point, click New Data Point.
- To edit an existing data point, click the row in the list.
In the Define a Data Point section, configure the following settings.
Field Description Name Enter a name for the information you want to extract. Description Enter a brief description of the extracted value. How many results will this Data Point return? If the regular expression will match more than one value in the email, select true
, and then indicate the number of expected matches. The add-on will store each matching value as an item in an array. For example, if the email will contain the start time and end time for a maintenance window, you can enter2
, and then define a regular expression that looks for the time pattern.Is this a Date or Time? Select the check box if the value is a date or time, and then indicate the expected format. See Defining the Date or Time Format. In the Create Regex Expression section, define patterns to find the value you want to extract.
- (Optional) In the Template column, select the template that most closely matches the pattern you are looking for in the email message.
The regex for the selected template is automatically populated as the initial regex. In the Initial Regex column, enter the regex for the entire pattern you are looking for.
(Optional) InTip The add-on supports the standard JavaScript syntax for regular expressions. To test your regexes, you can use online tools such as regexr.com and regex101.com.
In the Nested Regex column, enter the regex for subset of the initial regex that you want to extract as the value.Status subtle true colour Green title optional
For example, if your initial regex matches a pattern such asInvoice #123456
, you can use a nested regex to extract only the number itself as the value of the data point. In this example, the initial regex would be^Invoice\W#\d{6}$
, and the nested regex would be^\d{6}$
. If you don’t enter a nested regex, the entire initial regex is used as the value. (Optional) To
To add another regular expression, click the plus sign, and then repeat steps a – d.Status subtle true colour Green title optional
The handler evaluates the regexes in order. If it does not find a match for the first regex, it will evaluate the next regex for a match. The handler stops evaluating subsequent regexes as soon as it finds a match in the email message.Info title Use cases for multiple regexes This feature allows you to handle differences in formats for the same type of information. For example, an invoice number may be formatted as Invoice #123456 or Invoice #:123456, depending on the sender of the email. Likewise, you may have multiple number formats for invoices from different vendors.
- (Optional) In the Template column, select the template that most closely matches the pattern you are looking for in the email message.
...
- In the Define a Data Point section, select the Is this a Date or Time? check box checkbox.
A menu appears that lists templates for common date and time formats. - Select the template that most closely matches the expected format of the value in the email.
The pattern for the selected template is automatically populated in the field below the menu. - Edit the pattern to reflect how the value will be formatted in the email message.
The add-on supports the Java date and time pattern syntax. For example,MM/dd/yyyy
for dates formatted such as10/21/2006
. For a complete list of supported formats, see Java Documentation - Customizing Formats.
...