Rule for propagating label field to the sub-tasks

Claudio Rouillon June 21, 2021

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

1 vote
Answer accepted
Hyrum Steffensen _Appfire_
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.
June 21, 2021

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).

Claudio Rouillon June 21, 2021

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

Claudio Rouillon June 21, 2021

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

Hyrum Steffensen _Appfire_
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.
June 22, 2021

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

Regards,

Hyrum

1 vote
Answer accepted
Carlos Faddul
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 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

Claudio Rouillon June 21, 2021

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

Like Carlos Faddul likes this
0 votes
PRAMOD KUMAR REDDY KASIREDDY July 27, 2022

What about jira server? 

Hyrum Steffensen _Appfire_
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.
July 27, 2022

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