Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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.

2 answers

2 accepted

1 vote
Answer accepted

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

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

Suggest an answer

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

⏰ Day in the life of a Jira Admin!

Hello Community! We thoroughly enjoyed this just-for-fun conversation in the Jira Admin Group about what it's like to be a Jira Admin. For #JiraJuly, our talented designers created these graphics t...

886 views 2 22
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you