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:
- a field contains only letters and numbers. You could use
^[A-Za-z0-9]*$when you enter the regular expression. - a US Social Security field is populated in the correct format. You could use
^(?!666|000|9\d{2})\d{3}-(?!00)\d{2}-(?!0{4})\d{4}$when you enter the regular expression. - a UK Postcode field is in the correct format. You could use
^(GIR ?0AA|[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2})$when you enter the regular expression.
Warning: This condition is only available on text fields.
Text fields supported include:
- System fields - Description, Environment, and Summary
- Custom fields - Text Field (single line) and Text Field (multi-line)
Use this validator
You can add this condition to any transition in a workflow.
You can now test to see if this workflow validator works. Issues in your chosen project will throw an error if you try to transition the issue and the chosen form field does not have an input that matches the given regular expression.