Transition issue after all linked issues are closed

Issue #671 resolved
Norbert Grzebieniarz created an issue

Dear Fidel, i am testing your plugin for Jira. I have this case: In my workflow i have status called „Product Pending” i want to make transition for issues that are in this status to status „In Progress”, but condition is that all linked issues has to be in status „Done”. How can i do this? I am trying this solution https://bitbucket.org/fcarmario/jira-workflow-toolbox/issues/653/transition-an-epic-automatically-when-all but it isn’t working for me, This is what i have got:

The following text parsed in basic mode will be copied to Issue status: In Progress Post-function will only be executed if the following boolean expression is satisfied: count(filterByStatus(linkedIssues("relates to", linkedIssues("relates to")), "Done")) = count(linkedIssues("relates to", linkedIssues("relates to"))) - 1 This feature will be run as user in field Current user.

Comments (13)

  1. Fidel Castro Armario repo owner

    Hi @Tennaen,

    I don't understand exactly what you want to do:

    1. Do you want to add a validation to your transition from "Product Pending" to "In Progress" in order to guarantee that all the issues linked as "relates to" are in status "Done".

    2. Do you want that when you move your last linked issue to "Done" status, the "parent" linked issue automatically transitions from "Product Pending" to "In Progress".

    3. Do you want both previous use cases?

  2. Norbert Grzebieniarz reporter

    I just want 2nd case. I know how to set validation, but i have problems with making transition from "Product Pending" to "In Progress" for parent issue.

  3. Fidel Castro Armario repo owner

    I have realized that in the issue you are using as reference (Issue #653) I made a big mistake: I used a wrong post-function. You should use "Write field on linked issues or subtasks" post-function. I have updated my post and corrected it.

    Please, read my new post at issue #653 and you will see how you should configure the post-function.

    BTW, the boolean expression you are using at conditional execution parameter is correct.

  4. Fidel Castro Armario repo owner

    You should add that post-function into transition to Done status in the workflow of 'child issues', so that when the last child issue is transitioned to Done status, it will move parent issue to In Progress status.

  5. Norbert Grzebieniarz reporter

    I have set this in the workflow of 'child issues': screen2.jpg But still isn't working. Maybe there is something i do wrong? Issue Types - which should i select? I selected all issues that are in 'parent'. Status - i choose only Product Pending (from parent issue). I have also added few things to conditions filter.

  6. Fidel Castro Armario repo owner

    Try clearing parameter Conditional execution. Post-function should transition parent issue always, even if current child issue is not the last one being transitioned to Done status.

    BTW, always keep your JWT post-functions before system post-functions in execution order.

  7. Norbert Grzebieniarz reporter

    Conditional execution - cleared. I moved post-function to first position and when i'm trying to close child issue i get this error:

    org.ofbiz.core.entity.GenericTransactionException: Commit failed, rollback previously requested by nested transaction.

  8. Fidel Castro Armario repo owner

    Sorry, I forgot that you have a validation in the transition from "Product Pending" to "In Progress".

    Do the following:

    1. Keep conditional execution empty. You don't need it because of your validation that is blocking the transition in parent issue until all the child issues are in Done status.

    2. Set target field to Issue status (delayed writing). This way the transition is executed on parent issue once the last child issue is actually in Done status.

    3. Don't forget to keep your post-function before system post-functions.

  9. Log in to comment