Use 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.