Description
The 'Regular Expression Check' validator compares the value of a text, number or url's field against a regular expression. For example to verify that the content matches a given format.
Since version 1.4.10, selection fields, radio buttons and multi selection fields are also supported.
Configuration
You must select the field to validate and enter the regular expression. For example:
- [0-9]{4}-[0-9]{4} would allow numbers such as: 1245-7783
- [0-9]+ EUR$ would allow price tags such as: 34 EUR
- [a-z]* would allow an empty string, or any lower case word such as: yellow
- Option [A,B] would allow a selection of options: Option A, Option B or both.
For information on how to configure a validator in JIRA, see the JIRA documentation.
Be careful what kind of regular expressions you are using. Some might be exploited by a malicious person. See ReDoS . It is your responsibility as JIRA administrator to only use safe regular expressions.
You can define a custom error message for most JSU validators to provide a clear explanation of the situation to your users. If you leave this field empty, a default error message from Jira will be displayed on validation errors. This might be a bit too technical, and make it difficult for your users to understand and resolve the error.
Example
A workflow is configured so that the 'Resolve' transition has the 'Regular Expression Check' validator where 'TextField' has to match '[a-z]*'. If a user attempts to resolve an issue on this workflow, where the 'TextField' is for example '7 pieces', the validation will fail, and the transition will not be completed. However 'pieces' as content would be allowed.
Supported Field Types
JSU supports many different field types such as system fields and custom fields. However you should be aware, that not all field types are supported, and not in all combinations. We aim to cover the most important field types and are continuously adding and improving how different field types are supported. Some custom fields of other third-party apps might never be supported. You should always test anything you do with issue fields with JSU. You can try it with a free 30-day evaluation license.