Issues with Validation/Condition

Issue #424 resolved
Ben Richman created an issue

Hi there Fidel!

Cannot figure out how to do the following and i'm hoping your plugin can help.

On Transition "Ready for Testing" i want to make sure people have set issuetype "Bug Sub-Task" to status "Fixed" when the bug sub task priority is "critical" or "Major" but to skip validation on the bugs that are priority "Trivial".

There could be 2 bug sub tasks on one ticket, one Critical and one Trivial. The trivial one can be open and this is not a problem to transition the issue, but i want to make sure the Critical/Major one is set to "Fixed".

Can you please help!

Many Thanks.

Comments (6)

  1. Fidel Castro Armario repo owner

    Hi Ben,

    Use "Boolean condition with math, date-time or text-string terms" validator in transition "Ready for Testing" of parent's workflow with the following boolean expression:

    count(filterByPredicate(subtasks(), ^%{00016} != "Fixed" AND ^%{00017} in ["Critical", "Major"])) = 0
    

    Note that:

    • ^%{00016} is field code of Issue status in subtasks.
    • ^%{00017} is field code of Priority in subtasks.
  2. Ben Richman reporter

    This is blocking tickets which have not got any Bug Sub-Tasks on from going into test now

  3. Ben Richman reporter

    Bug Sub-Tasks are raised to show what was found during its first round of testing, if a ticket has never been tested, there are no bug sub-tasks and yet tickets are failing validation for this rule when they have none.

  4. Fidel Castro Armario repo owner

    I forgot to include the issue type in the validation. Try this boolean expression:

    count(filterByPredicate(subtasks(), ^%{00014} = "Bug Sub-Task" AND ^%{00016} != "Fixed" AND ^%{00017} in ["Critical", "Major"])) = 0
    

    I'm assuming that "Bug Sub-Task" are not linked issues, but sub-tasks.

  5. Ben Richman reporter

    Yeah that is right, that seems to have done the trick, thanks so much as always for your help Fidel, love your work man.

  6. Log in to comment