Automatic transition of workflow

Issue #481 resolved
gsep-support@daimler.com created an issue

Hello Team,

There are few requirement can you please help us.

there are 2 requirement 1) Automatic transition -- If the first subtask changed status from open to in Progress the relevant Story/ Task changes the status to In Progress (similar: Task/ Story to EPIC) --If all subtasks changed status to done the relevant Story/ Task changes the status to Review (similar: Task/ Story to EPIC).

2)Automatic transition

Transition the parent task (a user story, let’s say) to “In Progress” when ANY of its sub-tasks are “In Progress”. Also, transition the parent task back to "Open" if ALL of the sub-tasks are moved to OPEN.

How we can use workflow tool box for these condition.

Please let us know if anything else is required.

Thanks and Regards GSEP

Please Add microgenesis.debasish@daimler.com for any kind of mail communication.

Comments (16)

  1. Fidel Castro Armario repo owner

    Hi,

    I answer each use case in a different post.

    I find that the following 2 use cases are in practice the same:

    1. If the first subtask changed status from open to in Progress the relevant Story/ Task changes the status to In Progress
    2. Transition the parent task (a user story, let’s say) to “In Progress” when ANY of its sub-tasks are “In Progress”.

    I can't add watchers to the issue. You should ask the user to add himself as watcher.

    USE CASE 1

    If the first subtask changed status from Open to In Progress the relevant Story/Task (i.e., parent issue) changes the status to In Progress.

    Solution:

    Add Copy a parsed text to a field post-function into transition "Start Progress" of sub-task's workflow with the following configuration:

    • Target field: Parent's issue status
    • Parsing mode: basic
    • Text to be parsed:
    In Progress
    
    • Conditional execution:
    %{00042} != "In Progress"
    

    where %{00042} is field code for Parent's issue status.

  2. Fidel Castro Armario repo owner

    USE CASE 2

    If the first Story changed status from Open to In Progress the Epic changes the status to In Progress.

    Solution:

    Add Write field on linked issues or subtasks post-function into transition "Start Progress" of Story's workflow with the following configuration:

    • Source value type: Parsed text (basic mode)
    • Source value:
    In Progress
    
    • Target status: Issue status
    • Filtering by issue link type: has Epic
    • Filtering linked issues or subtasks by issue type: Epic
    • Filtering linked issues or subtasks by status: select all the statuses which are previous to In Progress in your workflow (typically Open, Reopened and To Do). Check also the rest of statuses different from In Progress if you want Epic to be transitioned to In Progress whenever a Story is moved to In Progress.
    • Linked issues or subtasks belong to: any project

    Leave empty the rest of configuration parameters of the post-function.

  3. Fidel Castro Armario repo owner

    USE CASE 3

    If all subtasks changed status to Done the relevant Story/Task (i.e., parent issue) changes the status to Review.

    Solution:

    Add Copy a parsed text to a field post-function into transition to "Done" status of sub-task's workflow with the following configuration:

    • Target field: Parent's issue status
    • Parsing mode: basic
    • Text to be parsed:
    Review
    
    • Conditional execution:
    %{00042} != "Review" AND count(siblingSubtasks()) = count(filterByStatus(siblingSubtasks(), "Done"))
    

    where %{00042} is field code for Parent's issue status.

  4. Fidel Castro Armario repo owner

    USE CASE 4

    If all Stories changed status to Done the Epic changes the status to Review.

    Solution:

    Add Write field on linked issues or subtasks post-function into transition "Start Progress" of Story's workflow with the following configuration:

    • Source value type: Parsed text (basic mode)
    • Source value:
    Review
    
    • Target status: Issue status
    • Filtering by issue link type: has Epic
    • Filtering linked issues or subtasks by issue type: Epic
    • Linked issues or subtasks belong to: any project
    • Conditional execution:
    count(filterByStatus(linkedIssues("is Epic of", linkedIssues("has Epic")), "Done")) = count(linkedIssues("is Epic of", linkedIssues("has Epic"))) - 1
    

    Leave empty the rest of configuration parameters of the post-function.

  5. Fidel Castro Armario repo owner

    USE CASE 5

    Transition the parent task (i.e., Story) back to Open if ALL of the sub-tasks are moved to Open.

    Solution:

    Add Copy a parsed text to a field post-function into transition to "Open" status of sub-task's workflow with the following configuration:

    • Target field: Parent's issue status
    • Parsing mode: basic
    • Text to be parsed:
    Open
    
    • Conditional execution:
    %{00042} != "Open" AND count(siblingSubtasks()) = count(filterByStatus(siblingSubtasks(), "Open"))
    

    where %{00042} is field code for Parent's issue status.

  6. Antônio Duarte

    Hi, Fidel, I tried your USE CASE 3 above to change the Parent Issue to the state "Planejamento Detalhado" when all its subtasks have reached the "Concluído" state, but Parent Issue didn't move as expected. See the attached image for details. I wrote the Post Function exactly on the subtasks workflow transition to their "Concluído" state. I tried using the names of the states all in upper case and also this way, but there was no difference. Just in time: to avoid the user to manually change the Parent Issue from "Planajamento Inicial" to "Planejamento Detalhado" in the wrong moment, I also created the Condition also attached in the images. Thanks in advance for your support.Post Function on subtask.jpgCondition on Parent Issue.jpg

  7. Fidel Castro Armario repo owner

    Hi @acelsoddbr,

    Select field "Parent's issue status (delayed writing)" in parameter Target status in post-function 5 in transition Aprovar. This way the execution of the transition will be carried out once all the sub-tasks are in status Concluído in order to ensure that the validation in parent issue workflow is satisfied.

  8. Antônio Duarte

    Hi, Fidel,

    Changed as requested, but no changes. All the sub-issues turned to "Concluido" state, but the parent issue didn't move.change 03-oct.jpgchange 03-oct 2.jpg

  9. Fidel Castro Armario repo owner

    Hi @acelsoddbr,

    Have you tested the validator in transition "Planejamento Detalhado". Please, try executing transition "Planejamento Detalhado" with all sub-task in status Concluido. The validator should pass.

    I suspect that the validator may not work, because with your current configuration sub-task's resolution should be empty. Please, try checking parameter: "Unselected resolutions are allowed".

    Since you have a validator in your parent's workflow, you can keep empty parameter Conditional execution in post-function in sub-task's workflow. Please, try clearing that parameter.

  10. Antônio Duarte

    Hi, @fcarmario , There is a communication problem. Let me explain better: In the parent issue, the transition from "Planejamento Inicial" to "Planejamento Detalhado' has a Condition, and it works fine: if ALL subtasks are in "Concluido" state, then the transition is visible and clickable; otherwise, the transition is NOT shown, exactly as expected. In the workflow of the subtasks issues, in the transition from "Em Aprovação" to "Concluído" there is the post-function to generate the automatic transition in the parent issue. I tried your suggestion to clean the parameter Conditional Execution, but it made no difference.

  11. Fidel Castro Armario repo owner

    HI @acelsoddbr,

    Please, do the following:

    1. Keep parameter Conditional Execution empty.
    2. Remove double quotes from parameter Text to be parsed, i.e., write Planejamento Detalhado instead of "Planejamento Detalhado". In basic parsing mode you don't have to write double quotes.
  12. Antônio Duarte

    Hi, @fcarmario ,

    You were right! All this time, the error was on the double quotes... It works perfectly now! Thank you very much! I have other questions, but I will open new support ticket. You can close this ticket with Resolution Code "success" . Antonio.

  13. Log in to comment