Automation - Update field Sub-Task dose not update other Sub-Task /same parent task
Asked by Alexander Wayne:

Hi, this is driving me crazy, I cannot figure out how to get **sub-task's** to update all other **sub-task's** with in the same **parent task.
Project** is**JSD** with a couple custom single line text fields and 4 custom task's added to the **Project** in**JSD**

My single line text field is called **"Provider ID"** The field is blank on creation for the**Parent Task** and all x4 **sub-task's .**   
I have tried soooo many different ways to make an automation rule.  

Currently, I have gotten a **sub-task to** update the **Parent Task** just fine.  
Just can not get the **sub-task** thats been edited to update the other **sub-task** 's.  

I have disabled all rules in the **project** except for the one I am discussing just in-case.  

![Automation_-_JIRA.png](https://community.atlassian.com/t5/image/serverpage/image-id/184617i8179FC85FEE817BB/image-size/large?v=v2&px=999 "Automation_-_JIRA.png")![Automation_-_JIRA-2.png](https://community.atlassian.com/t5/image/serverpage/image-id/184618i03E5FC37DFE71056/image-size/large?v=v2&px=999 "Automation_-_JIRA-2.png")  


Answers:
author: Curt Holley
body: Hi [@Alexander Wayne](/t5/user/viewprofilepage/user-id/4682523)

Welcome to the community!

Your "not working" branch is because the rule is triggered by a sub-task, the "For: Sub-tasks" will not work because there are no sub-tasks of the sub-task (i.e. trigger issue).

So, I would build a 2nd rule for when the parent issue is updated (by the "working" part of your rule) that triggers off the provider ID being updated and then you can deploy the "For: Sub-tasks"branch. Maybe add in a condition to only overwrite ones that do not already equal the trigger issue provider ID.

and remember to tick the  
"Allow rule trigger" in the Rule details  
*Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule.*

comments: author: Alexander Wayne
body: Hi, thanks. My fist picture has no sub task branch, nothing get updated  

Even if I set sub-task branch to update from the parent task if its been updated. still dose not work.  

Probably 4 different rules I'm testing currently, have a separate rule sub task rule with a branch or no branches. made condition after the parent branch to update to to any Sub-task. Nothing.  

Whats crazy, theres now viedo or mention of updating a sub-task from another subtask in jira, I can't be this first person.....


author: Curt Holley
body: OK. first rule should be the "Working" part of your 2nd screenshot. The bit that updates the Parent when a sub-task has had its provider ID updated.

2nd rule should be something like the below. Note: I don't have a provider ID field so used components. Just replace the "Components" with your field. Also the smart values are just a guess, but you get the idea....yeah?

![2ndr.png](https://community.atlassian.com/t5/image/serverpage/image-id/184626i387107D53BD7EE1B/image-size/large?v=v2&px=999 "2ndr.png")


author: Alexander Wayne
body: Thx, I made changes before I saw this, I'll try it... I posted a new commit


author: Bill Sheboy
body: Hi [@Alexander Wayne](/t5/user/viewprofilepage/user-id/4682523)

Just to confirm...is the originally triggering issue a subtask...leading to a change of the parent and all sibling subtasks?

If so, have you considered using a JQL branch for the issues with the same parent? For example:

* trigger: value changes for Provider ID field
* condition: issueType is your subtask type
* branch: on parent
  * condition: Provider ID does not equal the trigger issue's Provider ID
  * edit: update the parent's Provider ID
* branch: on JQL with parent = {{triggerIssue.parent}} AND issueType = *your subtask type*
  * condition: Provider ID does not equal the trigger issue's Provider ID
  * edit: update the sibling subtask's Provider ID

You would still need a rule for the case of the Parent being edited first, triggering an update to all subtasks. Do not enable "Allow rule trigger" with either rule using this design, or you could create a rule loop.

Kind regards,  
Bill

comments: author: Alexander Wayne
body: Hello [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) , thank you for taking the time to reply. I lost this post somewhere in the mix of things.  

To answer you question, no; i'm not trying to update the Parent Task for its siblings Sub-Task's. Many of custom fields only live in the sub-task and not the parent.  

Trying to copy field data from one sub-task to another sub-task.(same parent)  
I did make a 2nd tab(screen) in the parent task, and put all fields found in my custom sub-task in that tab to hide them.  
Then created a Automation rule for Sub-Task and Parent Task. Every thing working and updates any time there is a change.   

This is a messy solution and I not have 10 rules for one issue type.(certain fields get updated at different times of the week)  

Would prefer to have one master rule just to update sub-task \> to \> sub-task. Updating the Parent task is not necessary.  

**I tried your above solution for transitions:** When a **Custom_1** -**sub-task equals status = Done** transition **Custom_2** -**sub-task to status = READY** *(wrote this in short hand, not actual JQL for automation)* **Could not figure your JQL branch
Thx so much!**


author: Alexander Wayne
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) ![Automation_-_JIRA-5.png](https://community.atlassian.com/t5/image/serverpage/image-id/186172iD27C75C953FDD58A/image-size/large?v=v2&px=999 "Automation_-_JIRA-5.png")


author: Bill Sheboy
body: Looking at that error message and the JQL for the branch, that does not look correct. Please take a look to see if it matches what you wanted. Thanks!


author: Alexander Wayne
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313)Thank you ? I'm sorry I have to laugh. :-) I know its not correct.. Maybe its my fault. I asking how to fix it or what JQL to write?  

Did you get a chance to see my above commit paragraph above the picture?  
I tried to writ it best I know how to.  

JQL is new to me, so I can't find Atlassian or other source that talk about JQL branches when it comes to **sub-task** \> to \>**sub-task updates**


author: Bill Sheboy
body: Sorry, I was not trying to be snarky...I wondered if you missed seeing the error. :\^)

Please try this to return all the subtasks of that type which have the same parent issue:

```
parent = {{triggerIssue.parent}} AND issueType="Support Sub-task"
```


author: Alexander Wayne
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) You weren't haha All good! Can't wait to make a help video after I get all of this !  

So, I tried that, still nothing. **Says the branch dose not mach.** I have been playing with it for a few minuets. Even changed first condition just in-case.  

***Side-note** . In a separate window, I am validating the JQL by searching for the task. issueType="Support Sub-task*

*I do return all found sub-task in the search window.*   

++**Really appreciate the Help**++

![Branch Error.png](https://community.atlassian.com/t5/image/serverpage/image-id/186311iEEE0235A5D049AB8/image-size/large?v=v2&px=999 "Branch Error.png")


author: Bill Sheboy
body: Based upon the results in your audit log...what do you see if you run this in a stand-alone advanced search:

parent = SSD-346 AND issueType = "Support Sub-task"

If that returns nothing, that would explain your results as that triggering sub-task (of type "OPs Sub-task") has no siblings of the "Support Sub-task" type.

If it does return results, please check the names of your subtasks for spelling, capitalization and spacing differences from the JQL in the rule.


author: Alexander Wayne
body: [@Bill Sheboy](/t5/user/viewprofilepage/user-id/1685313) (posting from another account) You are correct, there was a typo!

Thank you so much for your help! I'll make a video and tag it here when I'm done.

I'll also try this JQL Automation Code for updating custom subtask fields.

It took meee 20 mins to try and replay so you were not left hanging...

![6545648161.png](https://community.atlassian.com/t5/image/serverpage/image-id/186349i0F275710BF30008F/image-size/large?v=v2&px=999 "6545648161.png")![5221514651.png](https://community.atlassian.com/t5/image/serverpage/image-id/186350i620EB6E0C8711FBA/image-size/large?v=v2&px=999 "5221514651.png")


author: Alexander Wayne
body: I made changes and can get sub-task to update, but only if I type in an update to the Parent task, then it updates all sub-task  

My rule 2 dose update the parent task, if i type a change in one of the sub-task, but dose not trigger rule 1 to run with any changes to re-manning subtask

![Automation_-_JIRA-3.png](https://community.atlassian.com/t5/image/serverpage/image-id/184639i043E06C5CFA990A2/image-size/large?v=v2&px=999 "Automation_-_JIRA-3.png")![Automation_-_JIRA-4.png](https://community.atlassian.com/t5/image/serverpage/image-id/184640iB498F84C331C65F6/image-size/large?v=v2&px=999 "Automation_-_JIRA-4.png")

comments: author: Curt Holley
body: Does your Rule 1 have this ticked in the Rule details?

"Allow rule trigger"  
*Check to allow other rule actions to trigger this rule. Only enable this if you need this rule to execute in response to another rule.*


Tags: sub-task