Check if the issue transitioned through all other previous transitions

Issue #776 resolved
Bharath B created an issue

I have a workflow in which there is a status which has 7 approvals as self transitions, below is the image of the workflow

Test WF.PNG

In this workflow at the approval status we have 7 transitions which are approvals, there is also a transition called Approve which transitions from Pending Approval -> Completed.

The condition that we want to have is before a user can make the Approve transitions the issue must have already transitioned through all the 7 approval transitions.

Please advice if this requirement can be done using your add-on.

Thank you Bharath

Comments (15)

  1. Fidel Castro Armario repo owner

    Hi @Bkappala,

    Issue #754 shows a recent approval workflow I have recently explained which is similar to the one you ask for. Please, read carefully, and let me know if you have any doubts on how to apply it to your particular case.

  2. Bharath B reporter

    Thanks for that response Fidel, I am a little confused with the approach in Issue #754, in my workflow case we would have people of different roles approving each of the transition

    Like CLD approval 1 will be by a set of different people, CLD approval 2 will be different set of people and Risk approval 1 and so on all the approvals will be different set of people.

    So the only condition that I have to check before I go to the COMPLETED status and hit the Approve transition is if the issue has all the 7 approvals or not that is it.

  3. Fidel Castro Armario repo owner

    Hi @Bkappala,

    Your graph of the workflow is a bit confusing, since some approval reflexive transitions are overlapped. Assuming that there are 7 reflexive transitions for the different approvals, I propose you the following solution:

    1. Create a checkboxes custom field called "Approvals", with 7 options: CLD 1, CLD 2, CLD 3, Risk 1, Risk 2, Risk 3 and Secondary Approval.

    2. Add to each of the 7 reflexive approvals a "Boolean condition with math, date-time or text-string terms" with a boolean expression like these ones: "CLD 1" not in %{nnnnn}, "Risk 3" not in %{nnnnn} or "Secondary Approval" not in %{nnnnn}, replacing nnnnn with field code for Approvals checkboxes field (not to be confused with JSD's Approvals field).

    3. Add to each of the 7 reflexive approvals a "Copy a parsed text to a field" post-function with a configuration like this:
    • Target field: Approvals checkboxes custom field.
    • Parsing mode: basic
    • Text to be parsed: + CLD 1, + Risk 3 or + Secondary Approval.

    Note that in my description of the solution I have explained the configuration for 3 of the 7 reflexive transitions for approvals. I hope you understand how to extend it to all the 7 transitions.

  4. Bharath B reporter

    I am having hard time extending it to all 7 transitions I get a parse error when I do that, below is the error could you please look into that I am sorry but could not figure that out please help me. error.PNG

  5. Fidel Castro Armario repo owner

    Hi @Bkappala,

    In transition "CLD Approval 1" you should use boolean expression "CLD 1" not in %{10106}.

    In transition "CLD Approval 2" you should use boolean expression "CLD 2" not in %{10106}.

    In transition "CLD Approval 3" you should use boolean expression "CLD 3" not in %{10106}.

    And so on. You should use a different validator for each reflexive transition.

  6. Bharath B reporter

    should the boolean expression be a Validator or a condition, because when I try putting them in the conditions I still see the Approve transition which I dont want to see untill all the 7 approvals are made

  7. Bharath B reporter

    also there is a Reject transitions where when rejected goes back to the committee after the renewal from committee all the approvals will have to be done again, now when I try rejecting the issues I cant see the approval transitions anymore again when I come back please suggest

  8. Fidel Castro Armario repo owner

    Insert post-function "Copy a parsed text to a field" into transition "Reject" with the following configuration:

    • Target field: Approvals checkboxes custom field.
    • Parsing mode: basic
    • Text to be parsed: leave this parameter empty.

    That post-function will clear field Approvals.

  9. Bharath B reporter

    I still see the Approve transition which I dont want to see untill all the 7 approvals are made

  10. Bharath B reporter

    So basically I want to hide the Approve transition untill all the seven approvals are done

  11. Fidel Castro Armario repo owner

    Hi @Bkappala,

    Insert "boolean condition" in transition "Approve" with the following expression:

    numberOfSelectedItems(%{10106}) = numberOfAvailableItems(%{10106})
    
  12. Bharath B reporter

    That worked like a magic thanks soo much for all the help i really appreciate that Fidel :-)

  13. Log in to comment