How do I automatically close all subtasks for a bug
Asked by Tim Cooley (TMNA):

I created automation to accept all subtasks when a ticket is created. However, the Bug uses Closed versus accepted.

So I created a ticket for Bugs as well, but every time it runs it kicks back an error. Any suggestions on what I am doing wrong?

![Screenshot 2023-02-09 115356.png](https://community.atlassian.com/t5/image/serverpage/image-id/239322i27D24F73B87829CF/image-size/large?v=v2&px=999 "Screenshot 2023-02-09 115356.png")


Answers:
author: Brant Schroeder
body: [@Tim Cooley (TMNA)](/t5/user/viewprofilepage/user-id/5115152) What is the error you are seeing? Do the bug subtasks use the same workflow as the other subtasks? Can the bug subtasks transition to accepted from all statuses?

comments: author: Tim Cooley (TMNA)
body: ![Screenshot 2023-02-09 121649.png](https://community.atlassian.com/t5/image/serverpage/image-id/239326i56EB507EA6B2CDAE/image-size/large?v=v2&px=999 "Screenshot 2023-02-09 121649.png")


author: Tim Cooley (TMNA)
body: I set it up so that it should. I tried with different statuses and am getting the same issue as above for all statuses I tried.


author: Brant Schroeder
body: [@Tim Cooley (TMNA)](/t5/user/viewprofilepage/user-id/5115152) Can you share your workflow on the subtasks?


author: Tim Cooley (TMNA)
body: ![Screenshot 2023-02-09 124109.png](https://community.atlassian.com/t5/image/serverpage/image-id/239333iFCCA15AF23F6B0C3/image-size/large?v=v2&px=999 "Screenshot 2023-02-09 124109.png")


author: Brant Schroeder
body: [@Tim Cooley (TMNA)](/t5/user/viewprofilepage/user-id/5115152) The only status that can transition to accepted is done. If the issue is not in the status of done then the automation will fail. You need to update the workflow so all statuses can move to accepted and the automation will work.


author: Tim Cooley (TMNA)
body: I have the same script running for non-bugs and it works, the subtasks have the same workflow.


author: Brant Schroeder
body: [@Tim Cooley (TMNA)](/t5/user/viewprofilepage/user-id/5115152) Can you double-check and see if there are any differences? It should not work if there is not a transition.


author: Tim Cooley (TMNA)
body: Everything I am seeing looks the same to me. When I click on the subtask, the work flow says "Non-Bug Workflow" for both.


author: Brant Schroeder
body: [@Tim Cooley (TMNA)](/t5/user/viewprofilepage/user-id/5115152) Feel free to share images of each flow and each automation. I am pretty sure that just adding the transition would fix the issue. I am not sure what the difference is in your automation or workflow.


author: Tim Cooley (TMNA)
body: Here is the automation I used for a non-bug as well as the workflows associated with it.

![Non Bug Automation.png](https://community.atlassian.com/t5/image/serverpage/image-id/239531iFFB63BAE195FAB35/image-size/large?v=v2&px=999 "Non Bug Automation.png")

Subtask Workflow (non Bug)

![Non Bug Subtask Workflow.png](https://community.atlassian.com/t5/image/serverpage/image-id/239529i23759A8D23F0DF65/image-size/large?v=v2&px=999 "Non Bug Subtask Workflow.png")

Parent Workflow (non bug)

![Parent Ticket (non bug) Worflow.png](https://community.atlassian.com/t5/image/serverpage/image-id/239530iF4EC42E6709CD8D6/image-size/large?v=v2&px=999 "Parent Ticket (non bug) Worflow.png")


author: Tim Cooley (TMNA)
body: Here is the automation for a bug (Although it looks like I should be able to combine them into one automation, which I tried and assumed I needed to split.)

![Bug Automation Workflow.png](https://community.atlassian.com/t5/image/serverpage/image-id/239535i2CB93C6C24E60506/image-size/large?v=v2&px=999 "Bug Automation Workflow.png")

Bug Subtask Workflow (appears to be the same as the non-bug)

![Bug Subtask Workflow.png](https://community.atlassian.com/t5/image/serverpage/image-id/239534i7D2F0B6413DBF407/image-size/large?v=v2&px=999 "Bug Subtask Workflow.png")

Bug Parent Workflow

![Parent Bug Workflow.png](https://community.atlassian.com/t5/image/serverpage/image-id/239533iC1198028DE189786/image-size/large?v=v2&px=999 "Parent Bug Workflow.png")


author: Brant Schroeder
body: On the non-bug if a subtask is in the status of in progress and you transition the parent to accepted does the sub-task transition to accepted?


author: Tim Cooley (TMNA)
body: No. I tried that.


author: Brant Schroeder
body: [@Tim Cooley (TMNA)](/t5/user/viewprofilepage/user-id/5115152) What account is each automation running under?


author: Tim Cooley (TMNA)
body: I am unsure what you are asking.


author: Brant Schroeder
body: Sorry, should have used the correct terminology. Who is the [actor](https://support.atlassian.com/cloud-automation/docs/what-is-a-rule-actor/) on each of the automations?


author: Tim Cooley (TMNA)
body: I read that article, it is the same for both instances.


author: Simeon Leatherland
body: Hey!

Great question, I can't see the issue off the top of my head, if you want us to look into this deeper for you you can contact <https://getsupport.atlassian.com> :)

Simeon


author: Tim Cooley (TMNA)
body: [@Simeon Leatherland](/t5/user/viewprofilepage/user-id/4585933) How do i sue that site to get better support? Still having this issue.


Tags: advanced-roadmaps

automation

bug

cloud