Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,323,851
Community Members
 
Community Events
168
Community Groups

Rule for propagating label field to the sub-tasks

Hello -- we want to automate the update of fields on the sub-tasks. Question, is there a rule someone might want to share to propagate (copy) the labels field to all the sub-tasks? Much in the same way the Sprint value is copied down to the sub-tasks.

Thanks.

3 answers

2 accepted

Hello Claudio,

To copy labels to subtasks, create a rule "For Sub-tasks", then a new action, "Edit issue fields" (see screenshot below).

 

Screen Shot 2021-06-21 at 6.54.07 PM.png

 

As an alternative, you could add an action to run a script via Power Scripts (see screenshot below).

Screen Shot 2021-06-21 at 6.59.00 PM.png

The SIL script would look something like:

string [] subtasks = subtasks(key);
for (string subtask in subtasks) {
    %subtask%.labels = key.labels;
}

 

The advantage of a SIL script is flexibility. Let's say you wanted to copy a label only if the subtask status is closed. For example:

string [] subtasks = subtasks(key);
for (string subtask in subtasks) {
    if (subtask.status == "Done") {
        %subtask%.labels = key.labels;
    }
}

 

Please let the community how everything goes!

Regards,

Hyrum

Due to Confluence Cloud security features, you may need to open the documentation in incognito mode or by logging out of Confluence.

Please note that I am a product engineer for Power Scripts and I work for Anova Apps (Appfire).

Thanks Hyrum, I have enabled such a rule except that for now, I want to manually trigger it and not do it as part of a status transition.

Question - where can I see a button or click to execute a rule from the current issue. See below my rule for reference.

New Jira rule for labels.JPG

Hello Hyrum, I worked out how to run the rule from within the parent issue. Also the precise setting was to copy labels from parent issue (see below) and it worked. Tks again.

New Jira rule for labels_v2.JPG

Glad to help, Claudio! To run a rule manually, see this documentation.

Regards,

Hyrum

1 vote
Answer accepted
Carlos Faddul Community Leader Jun 21, 2021

Hello @Claudio Rouillon ,

You can use Automation for Jira, and use the branchs to do this.


Using the component -> Branch rule/ relate issues, and setting "Sub-tasks" then you can copy the values using the action "Edit Issue" to set the fields and values that you want to copy or define.

 

aaaaaaaaaaa.pngbbbbbbbbbbbb.png

Thanks Carlos, I worked it out now. Update below.

Like Carlos Faddul likes this

What about jira server? 

Hello Pramod,

The solutions posted above should work in Jira DC/Server without modification. 

Hyrum

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

An update on Jira Software customer feedback – June 2022

Hello Atlassian Community! Feedback from customers like you has helped us shape and improve Jira Software. As Head of Product, Jira Software, I wanted to take this opportunity to share an update on...

2,537 views 6 22
Read article

Atlassian Community Events