DescriptionThe 'Regular Expression Check' validator compares the value of a text, number, or url's URL field against a regular expression. For , for example, to verify that the content matches a given format. ConfigurationYou must select the field to be checked and enter the regular expression. For example:Image Removed. ExampleA workflow is configured so that the 'Resolve' transition has the 'Regular Expression Check' where 'TextField' must match '[a-z]*'. If a user attempts to resolve an issue on this workflow, where the 'TextField' is, for example, 7 pieces , the check will fail, and no action will be performed. Pieces alone, would meet the content criteria. Image Added[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.
| Custom Error Message | Example
A workflow is configured so that the 'Resolve' transition has the 'Regular Expression Check' 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 check will fail, and no action will be performed. However 'pieces' as content would be allowed.
Supported Field TypesDetailed Documentation See detailed documentation on Regex can be found here: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html It is quite technical though. A good website that could help further is https://www.freeformatter.com/java-regex-tester.html where you can test them and also have a less technical documentation with examples. Hope this helps.
For information on how to configure a check in JIRA, see the JIRA documentation.
If the field is a multiline text field, the text will be split on the newline character before applying the expression to each token. The HTML editor may add an additional newline character when pressing the "enter" key.
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.
Include Page |
---|
Custom Error Message | for technical descriptions. You can also use the Java Regular Expression Tester to help with testing and to see more examples.
Additional configuration options include:
Concatenate multiple values
This option is only available for fields that can store multiple values including the system fields "Affected Version/s", "Components", "Fix Version/s" and "Watchers" as well as most custom fields with multiple settable values.
If this box is unchecked, the regular expression is applied to each of the field's values and each value must match the regular expression but not all must be present.
If this box is checked the values are concatenated with the separator ", " (i.e. the values [Option A, Option AA] are concatenated as the string value "Option A, Option AA") and the exact sequence must match. Typically this option is used to check if a particular sequence of values is selected.
The order in which the values are concatenated depends on the natural sorting order of the field value type. Since the values may be stored in the issue in an unspecific order, values that do not have a natural sorting order may be concatenated in an unspecific order.
Split on newline characters
This option is only available for text area fields including the system fields "Description" and "Environment" as well as text area custom fields.
If this box is unchecked, the regular expression is applied to the entire field multiline text value.
If this box is checked the field multiline text value will be split into individual lines and each line is evaluated against the regexp separately.
Note |
---|
Take care when using regular expressions as some might be exploited. Ensure that you only use safe regular expressions. See Regular Expresssion Denial of Service (ReDoS) for more information. |
Optional error message
You can define a custom error message for 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.
Supported field types
Include Page |
---|
| Supported Field Types |
---|
| Supported Field Types |
---|
|