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 expressionFor example, you may want to use this condition to ensure:

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

  1. Select the Regular Expression Condition [ScriptRunner] condition.

    For details on how to navigate to ScriptRunner workflow functions, see Navigating to Workflow Functions.

  2. Enter a description of the condition in Note.

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

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

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

  6. Enter a Preview Issue Key to test the regular expression on an existing issue. 
  7. Click Update