I am trying to restrict a workflow transition so that it can only happen when a field's value begins with an R (the full value can be R or I followed by a number e.g. R1234, I543). The field type is a text field (read only).
The rule type I am trying to use is "Validate a field"
Validate that Field > Matches regular expression
For this Field > I/R+Number
Expression > this is where I am having trouble!
I have tried all sorts of variations of R, ^R\d, ^R/d$, R+[0-9], R[0-9] and every time I get Transition failed Field I/R+Number with actual value' R458' does not match regular expression (whatever I've entered)
Am I doing this completely wrong, or have I just got my syntax wrong?
Many Thanks!
Hi @GaryBilton
Regex is not my speciality, but it looks like all the examples you've given are for R + one digit, which would not match against R458, have you tried something like
^R\d{1,5}$
This should give you R + one to five digits
and on testing, that worked against a field with R458, but failed the regex when I used I458
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.
Hi @GaryBilton , welcome to the Atlassian Community and thanks for your post.
I found this in the documentation https://confluence.atlassian.com/jirakb/using-forms-regex-validation-1255454685.html
Does that help at all ^?
Best wishes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Valerie, That was the document I was working from. From that and the examples that are shown under the rule when you enter it I can't see why R[0-9] or ^R\d don't work. Either I'm entering it incorrectly or I'm using the wrong type of validation.
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.