Auto Update Subtask field upon creation based on parent issue
Asked by kiran.gangadikar:

Hello community,

I have the following case scenario that i'm fighting with.   
When I create a parent issue (e.g. user story), we have customised field "TeamX" as mandatory to be updated. Now, i would need this field to be populated on subtasks as well whenever i creat them.

The reason is manually do not want to update TeamX field each time when they create subtasks.

I would be great if you help with the automation of this.


Answers:
author: Dexter de Vera
body: Create Automation:

When: Issue created

Condition: Issue fields condition - issuetype equals Sub-task

Condition: Related issues condition - Parent - Exists

Then: Edit issue - TeamX copy parent Issue

NOTE: both parent and child should have TeamX field.

This automation only copy the field when new subtask created have parent.

![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/311312i7BF6AA361FF5CB9E/image-size/large?v=v2&px=999 "image.png")![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/311313i56B0F663866FDC61/image-size/large?v=v2&px=999 "image.png")

comments: author: kiran.gangadikar
body: Hi [@Dexter de Vera](/t5/user/viewprofilepage/user-id/4657717)

Thanks for the reply!

Yes i had tried this rule earlier, but the problem is "TeamX" is a mandatory field. So while creating sub task its going to ask for manual update. Is there a way to make this field mandatory only at parent level tickets and not the subtasks? If we have a way then this rule might work i think.


author: Dexter de Vera
body: You can update the field upon creation of ticket in automation.

ACTION - Create issue - select the field - then copy from parent issue.


author: kiran.gangadikar
body: Thanks for the reply, i created an automation and it creates sub task upon creation of parent ticket. This sort of fixes a problem, however if we have more subtasks while planning a sprint, the only option is to clone and then amend it accordingly right?  

Please confirm.


author: Dexter de Vera
body: Yes. Also you can add the automation i show you before. When subtask created - parent exist - copy parent value. You can just assign any value when creation and it will auto update base on parent value.


author: GNarsimhagowda - Empyra
body: HI [@kiran.gangadikar](/t5/user/viewprofilepage/user-id/5419370) ,

I have created a simple rule to copy the field hope this works for you.

![2024-03-11_16h20_24.png](https://community.atlassian.com/t5/image/serverpage/image-id/311314iFA150B7A245958D5/image-size/large?v=v2&px=999 "2024-03-11_16h20_24.png")

Thanks.

comments: author: kiran.gangadikar
body: Hi [@GNarsimhagowda - Empyra](/t5/user/viewprofilepage/user-id/5393239)

Thanks for the reply!

Yes i had tried this rule earlier, but the problem is "TeamX" is a mandatory field. So while creating sub task its going to ask for manual update. Is there a way to make this field mandatory only at parent level tickets and not the subtasks? If we have a way then this rule might work i think.


author: John Funk
body: HI Kiran - Welcome to the Atlassian Community!

Are you using the built-in Teams field in Jira? You said you have a custom field - what type of field exactly is it? Group picker? Multi-user picker?

comments: author: kiran.gangadikar
body: Hi John,

Thank you.

The customised field created is "TeamX" and the type is "Select list (single choice".


author: kiran.gangadikar
body: Also "TeamX" is a Mandatory field while creating tickets.


author: John Funk
body: Very good - that should make it very easy. Can you share the screenshot of your rule now? And what is missing/not working with the rule?


author: kiran.gangadikar
body: Currently, i have setup automation rule as below -  

This automatically creates sub task for parent issue and copies field value. So the rule is working fine if we consider each parent to have one sub-task. However, if we need to create more sub-tasks for a parent story, then we have to clone and amend them accordingly.

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