Regular Expression Validator

Use the Regular Expression validator to validate that the text field input on a transition screen matches a regular expression (regex) before transitioning the issue. A regular expression is a sequence of characters that specifies a pattern. For example, you may want to use this validator to ensure:

  • Social Security field is populated in the correct format.
  • A UK Postcode field is in the correct format.

The Regular Expression validator is only available on text fields.

You can add this condition to any transition in a workflow. 

  1. Select the Regular Expression [ScriptRunner] validator.

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

  2. Enter a description of the validator in Note.

  3. Select the transition screen Field to validate with the regular expression.
    Only text fields on the selected transition screen show.

    Text fields supported include:

    System fields - Description, Environment, and Summary,

    Custom fields - Single line and multi-line.

  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 validator only checks if the regular expression exists in part of the text field value. 

  6. Enter an Error Message to display to the user if the regular expression does not match the field value. 
  7. Click Update