Issue with validation
Hi Fidel,
I am using this validation:
If field Last comment matches the following parsed regular expression: (\w+). Message to show when validation fails: "Debe indicar justificacion de esta accion.".
The idea is validate that a comment is entered in a WKF transition. But the user enters a comment and the validation fails. I used \w+ to avoid entering just blanks.
This is version 2.1.33
Comments (12)
-
reporter -
reporter I tried matches(%{00109}, ".+") but I get the same error.
-
repo owner Hi Adolfo,
I can't reproduce your problem. In my tests using 2.1.33 and JIRA 6.4.10 all is working as expected.
One question: Isn't it possible that you want to check comment entered in transition screen instead of last comment?
The difference between both virtual fields is that the first one returns empty string if no comment is entered in transition screen, and the second one returns the last comment entered in the issue, even if no comment is entered in transition screen.
Field code for transitions comment is %{00127}.
-
repo owner - changed version to 2.1.33
-
reporter You're correct, I was using %{00109} instead of %{00127}.
However I don't understand why the validation was failing with %{00109}, since the issue has comments and \w+ matches it.
Thanks for your support.
-
repo owner I don't understand it also, since I can't reproduce your problem.
I'm using the following configuration that it's working as expected:
Can you please, provide screenshots of your validation configuration?
-
reporter The problem is the regex. With \w+ I enter ThisMatch and the transition goes OK. But I enter This Match the transition fail... I need a regex that avoids entering just blanks.
-
repo owner Use "Boolean validation with math, date-time or text-string terms" with the following boolean expression:
matches(trim(%{00127}), "\\w+")
-
reporter That stops blanks, but it doesn't allow blanks between words.
-
reporter I ended up with this working as expected:
f field Transition's comment matches the following parsed regular expression: ((?:\S+\s*)+).
-
repo owner Use "Boolean validation with math, date-time or text-string terms" with the following boolean expression for a requiring a comment with at least 3 words:
matches(%{00127}, "((?s).*\\w\\b){3}")
Modifying it for any number of words is trivial.
-
repo owner - changed status to resolved
- Log in to comment
I escape \w but I get the same error.