Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Copying specific labels from linked issues

Scott Federman December 22, 2023

Hey all, I'm looking for some help configuring an automation that where as if an epic contains a specific set of labels (integration, system, functional) and there are stories linked to that epic, that those specific labels are copied to the story. 

Additionally we will have test and defect issue type tickets linked to stories, whereas, if the story contains any of the specific labels (integration, system, functional) then those specific labels are copied to the linked tests and bugs.

Any help with this would be incredible. 

1 answer

0 votes
Bill Sheboy
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.
December 22, 2023

Hi @Scott Federman 

Using automation rules requires learning and experimentation.  I recommend trying to create this rule, and if you run into challenges the community can help.

If you have already started a rule, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

If you have not started a rule, please refer to these documentation and example sources:

 

Additionally, the two rules needed could be triggered on issue created and issue updated, use conditions to check the issue type and labels, and then use if / else conditions to add each label to the branched-to child issues. 

I hypothesize a rule like this may have challenges due to update-timing problems, and so a better approach may be to determine all the labels to add first, and then make a single edit per child issue.

I recommend partnering with your Jira site admin to have them help you create this rule.

Kind regards,
Bill

Scott Federman December 22, 2023

Thanks Bill, 

Yes, I have already created an attempt at an automation. I can copy lables from epic to story but copying from story to test and/or bug is not working. Is also adding the full list of labels as opposed to the specific one in the list that is shown in the epic.  

Bill Sheboy
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.
December 22, 2023

Would you please post an image of your complete rule, the action where the labels are added, and the audit log details?  Those may provide context to explain what you are observing.

Without seeing the rule, I suspect the cause is either in a condition or in the edit action adding the labels.

Scott Federman December 24, 2023

Yes thank you. Attached is the rule and the logsCapture2.PNG

Capture.PNG

Bill Sheboy
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.
December 24, 2023

Thanks for the additional information as that leads to some other questions / insights:

You originally described copying labels from an Epic to its children Stories.  And then you want to further copy those labels to any Test or Bug (defect) issue types which are linked to those child Stories.

 

In automation rules, branches which could be on more-than-one-thing are executed in parallel and asynchronously.  In fact, there is no guarantee of when the branch will finish, up until the last step of the rule.  Please look here to learn more about that design: https://support.atlassian.com/cloud-automation/docs/jira-automation-branches/#Ordering-of-branch-executions

What this means for the rule you show is that a race-track condition can occur, where the same issues are potentially being edited by the different branches.  That will likely cause problems.

A common solution for this is to use two rules: one to copy labels Epic -> Story, and another to copy labels Story -> linked Test and Bug (defect) issues.  That will ensure a specific Story has finished updating before trying to change its linked issues.

  • rule 1
    • trigger: issue field updated for labels
    • condition: issue type is Epic
    • condition: label field contains the values you wanted to check
    • branch: on the children of the epic
      • condition: check if the labels are needed
      • action: edit the labels
  • rule 2 -- For this rule only, enable the option "Allow Rule Trigger" in the details, as the actions of rule 1 will trigger this one.
    • trigger: issue field updated for labels
    • condition: issue type is Story
    • condition: label field contains the values you wanted to check
    • branch: on the linked issues
      • condition: issue type is either Test or Bug (defect)
      • condition: check if the labels are needed
      • action: edit the labels

 

There is another solution approach using one rule, which first gathers all the possible Story, Test, and Bug issues in the Epic's chain which might need updates, and then branches over them for updates.  However that approach is both more complicated and is more likely to exceed the 100 issue limit for branching.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events