Regular Expression Condition
Use the Regular Expression Condition to stop an issue from being transitioned if a text field input does not match a regular expression. For example, you may want to use this condition to ensure:
- A Social Security field is populated in the correct format.
- A UK Postcode field is in the correct format.
The Regular Expression condition is only available on text fields.
You can add this condition to any transition in a workflow that allows conditions.
Select the Regular Expression Condition [ScriptRunner] condition.
For details on how to navigate to ScriptRunner workflow functions, see Navigating to Workflow Functions.
Enter a description of the condition in Note.
Select the Field to validate with the regular expression.
Text fields supported include:
System fields - Description, Environment, and Summary,
Custom fields - Single line and multi-line.
Make sure your selected field is on the screen for the project(s) your condition applies. This condition function will check field values even if they are not on the screen.
Enter the Java Regular Expression to validate the field value against.
Click Show Examples for common regular expressions.For a tutorial on how to write a regular expression, see Oracle's Regular Expressions tutorial.
We recommend you test your regular expression before saving.
Optionally, select Match Entire String. When selected, all text input in the chosen field must match the regular expression provided. By default, the condition only checks if the regular expression exists in part of the text field value.
- Enter a Preview Issue Key to test the regular expression on an existing issue.
- Click Update.