Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Mode Selection Options: Regex and Basic

Introduction:

Mode provides users with the flexibility to input data freely in Basic Mode or utilize regular expressions in Regex Mode. This empowers users to define patterns according to their preferences. The following guide outlines the process of mode selection, the Pattern Mapping dialog box, and validation procedures in both Basic and Regex Modes.

To initiate the Pattern Mapping dialog box, click on the "Add Rule" button to create a new rule, or, for an existing rule, choose the "Edit" button to make modifications, and for duplication, select the "Clone" button.

...

Upon selecting any of these options, the Pattern Mapping dialog box will appear as a pop-up window, as illustrated below.

...

The highlighted yellow area represents the Mode checkbox, with unchecked indicating Basic Mode and checked indicating Regex Mode. Default mode is Basic, checking the box switches to Regex. Multiple mapping rows can be added.

...

In Basic Mode, users can freely input data within curly braces "{value}" into the Pattern Field.

...

In Regex Mode, users can utilize regular expressions in the Pattern Field.

Pattern Field Validation:

...

If the 'Pattern' field is empty or not in the expected format when adding a pattern mapping, a popup message appears at the top, highlighting the respective field for user attention and correction.

...

After carefully selecting all the fields and ensuring that the specified condition in the Pattern field is met, proceed to click on "Add Pattern Mapping" to observe the newly created rule on the 'Configure Comment Handler' pageUse the check box highlighted below in the Create/ Edit or Clone dialogue to enable Regex mode for a particular rule item.

...

Next, provide a regex pattern in the ‘Pattern’ input. PFB is an example.

...

When in action, the input rich text field would be checked against the regex pattern for a match, if a match is found the same would be updated to the ‘Priority’ field in Jira.

Regex Helper

We recommend to Visit the ‘Regex Helper' module available in the 'Manage Apps’ section of your Jira to test Regex patterns against input texts before using them in Rules.

...

The Regex Helper tool is designed to assist users in performing regular expression matches on input data. Users can input a valid regular expression and a set of data, and the tool will automatically perform the match.

...

Valid Regular Expression:

Crafting a valid regular expression requires precision in considering the pattern's structure and matching criteria. Successful matches, shown in blue, exemplify the data to be inserted into the custom field on the issue page, while red highlights indicate mismatches. Regular expressions serve as potent tools for efficient pattern matching in programming and text processing.

...

In this example, the given regex pattern is returning a value ‘High’ based on the input data. Once the same pattern is used in a Rule as shown below, the rule can set the field ‘Priority’ as ‘High’.

...

Invalid Regular Expression or Input Data:

To test for errors, enter either an invalid regular expression in the "REGULAR EXPRESSION" field or provide invalid input data in the "INPUT DATA" text area. Leaving one of these fields empty will trigger an error message, indicating that no match was found. This validation process ensures that the system accurately detects and communicates issues with either the pattern or the input data, helping to maintain the integrity of the matching mechanism.

...


Clearing Input Fields:

To clear the input fields, entered values in both the "REGULAR EXPRESSION" and "INPUT DATA" fields, and then click the "Cancel" link. This action will swiftly reset both fields, providing a convenient way to start fresh or make changes to the regular expression and input data without manual deletion. The "Cancel" link simplifies the process, ensuring a user-friendly experience in managing input data and refining regular expressions as needed.