Copy labels from subtask to parent issue

Benjamin September 3, 2021

I've seen many examples when a label is copied from parent to sub-task. Is there a way to update the labels on the parent issues when we update the subtask?

3 answers

0 votes
Daniel Ebers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 8, 2021

Hi @Benjamin

with the easier options available from user interface the labels are likely replaced and overwritten. You need to add them using advanced field edit (using JSON).

There was a previous post which seems to discuss this a bit more elaborate, from what I remember for sub-tasks it was reported to be possible but not so easy:

https://community.atlassian.com/t5/Jira-Software-questions/Automation-rule-to-sync-labels-between-a-JSM-ticket-and-its/qaq-p/1733473

Please note that the scenario was not 1:1 identical.

The core part to probably look for is:
{"update":{"labels":[{{#issue.labels}}{"add":"{{.}}"{{^last}}},{{/}}{{/}}}]}}
In that case the user wanted to copy to sub-tasks - but you would need the other way around. So you need to make sure you adapt parts of the logic, for example like Fabian said to pay attention for the proper branching.

Regards,
Daniel

Benjamin September 8, 2021

Thanks for the suggestion! Let me look them up! Need some studying on how this works exactly.

0 votes
Fabian Lim
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2021
Benjamin September 5, 2021

This is good! thanks Fabian, however, my use case is slightly different. E.g. Parent has 4 subtasks, each subtasks has different labels, the Parent should display all the labels within the subtasks. Is that possible?

0 votes
Gaurav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2021

Hello @Benjamin 

Welcome to the community!!

Automation rules can be used to achieve this. The rule can be triggered when the label on a sub-task is updated and the value can be copied to the label for the parent.

Please let me know if you have further queries on this.

Kindly accept the response if this helps in resolving the query.

Benjamin September 3, 2021

Can you guide me through how I should set up the rules?

Gaurav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 3, 2021

Hello @Benjamin 

Please navigate to Project settings --> Automation --> Create rule

This will help you create a new automation rule.

Arnav April 26, 2022

Hi @Gaurav ,

Please find the below rule I have created for "Replicate labels from subtask to Parent"

Replicate labels from subtask to parent.PNG

Please help me where I am missing.

I would like to replicate the labels from subtask to Parent.

Suggest an answer

Log in or Sign up to answer