I'm trying to create a "Regular Expression Check" validator and the field I'm checking is "Safety Impact" and it is a single choice drop-down with 3 choices (Yes, No, TBD). I used the following regex: ^(Yes|No)$ but it does not work. No matter what value is selected Jira will not allow the transition. It is the only validator on the transition.
I even double checked myself with a regex tester. Is there something I'm missing with how Jira handles this. Below is how the validator is listed in Jira:
The field Safety Impact content must match against the regular expression ^(Yes | No )$
Here is screenshot of error occurring showing that the value in the Safety Impact field is set to No
Hi @john_monteith ,
I tested this and recreated a custom field single-select drop-down with values: "Yes" "No" "TBD" - Then, I used the following RegEx for the workflow field validator ^(Yes|No)$
This worked for me successfully, as intended.
I noticed your RegEx in bold has spaces between the other RegEx characters. That would surely give an error, if the actual value does not have spaces.
Might that be affecting the outcome here? Also want to confirm that your drop-down values in the custom field don't unintentionally have spaces after them?
Thanks, I didn't pick up on the spaces, I know that they are "characters" in a string but just missed that. Eliminating the spaces did the trick. So embarrassing :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No worries at all! It happens to the best of us. The number of times I've done something like this is more than I care to admit lol
Keep rocking your validators!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
I have not tried to put multiple options in the Regular Expression Check for two values but maybe try:
Option [Yes,No]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps I should have included that in my post. Based on what was listed in the information field for this validator
I also tried:
Option [Yes, No]
[Yes, No]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Maybe try with no spaces
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@john_monteith - did you try this for future reference?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.