Text comparison is failing in Condition evaluation
Using the "Boolean condition with math, date-time or text-string terms" as a Condition To Transition, I am comparing "Only if the following boolean expression is true: %{Previous issue status} != %{Target status}".
However, even when this true, the workflow button does not show up. But when I use the same function "Boolean condition with math, date-time or text-string terms" as a Validator To Transition to do the same comparison, it works fine.
Comments (6)
-
repo owner -
reporter Fidel,
No, it does not work for me. I meant to have an equal check %{00138} = %{00177}. Meaning I need to confirm the specific status they are trying to move to, not just if that is an acceptable status to move to.
I am using this to implement returning to last status functionality. Any status can move to Onhold. I then have a transition back to each of the 20 status, but I need to show only one transition that matches the last status they were in.
Thanks for the wiki link. I was not expected that same field to behave differently based on where it was used. That usage on Conditions seems like it should be different parameter like "Available Statuses" or something.
-
repo owner Hi @mfukuda,
Yes, you are right. I'm considering changing the behavior for conditions, and create a virtual field "Achievable statuses". The problem here is that it can break back compatibility for some users.
-
repo owner Hi @mfukuda,
Try version 2.2.42_beta_5. In this version:
- Field Target status has the same behavior in conditions, validations and post-functions.
- Field Achievable statuses has been added, which returns a comma separated list with all the statuses achievable from current issue status.
-
reporter Fidel,
That seems to work. Thanks!
-
repo owner - changed status to resolved
Fixed in just released version 2.2.42.
- Log in to comment
Hi @mfukuda,
Virtual field "Target status" behaves differently depending on whether it's used on Conditions, or in Validators and Post-functions.
Example: the value of Target field for transition "Start Progress" in the default JIRA workflow is:
In Progress
In Progress, Resolved, Closed
This explanation is in Virtual Fields.
The following boolean expression checks whether previous status is not among the achievable statuses from current status:
where
%{00138}
is field code for Previous status, and%{00177}
is field code for Target status.Is that boolean expression ok for your needs?