Forums

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

Automation to add label based on parent label

anne.gerten
Contributor
June 28, 2024

Hi,

I am looking for this automation:

When creating a new issue, if the parent has label1, then the new issue should also get label1. How can that be setup?

 

Thank you!

3 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
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.
June 28, 2024

Hi @anne.gerten 

What have you tried thus far to solve this need?

If you have a rule that is not working, please post images of the rule and audit log details, and explain what does not work as expected.

If you have not started a rule, I encourage you to try to do so.  Successfully using rules requires learning and experimentation.  To get you started on creating your rule, please refer to these documentation and example sources:

 

To help with your scenario, you describe wanting to test the parent field of an issue when it is created.  What do you want to do if that parent is added later or changed, or if the label is changed manually?  Those might require additional rules to help.

 

For your first case, this template of a rule may help:

  • trigger: issue created
  • action: re-fetch issue (I recommend always adding this after the Issue Created trigger to prevent timing / racetrack problems.)
  • smart values condition: check if the parent label is present
    • first value: {{issue.parent.labels}}
    • condition: contains
    • second value: label1
  • action: edit issue
    • select the labels field from the dropdown, and at the right under ... select ADDREMOVE
    • then add label1 in the Values to add field

 

Kind regards,
Bill

Sundram Trivedi
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.
May 27, 2025

Hi Bill Sheboy,

I’ve created a separate rule for handling this, and it’s working fine. However, my main requirement is that no labels should be removed from the child issue when the parent is changed or when the labels on the parent issue are updated. I want the child to keep all its existing labels, even if some labels are removed from the parent.

Can you help me in this.

thanksimage.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.
May 27, 2025

Hi @Sundram Trivedi 

As this is a very old thread, please create a new question using the "Ask a question" link at the top of the page.

Until we see your new question...If you read the other posts in this thread you will note using the ... ADDREMOVE option at the right side of the field.  As you want to add the parent's label values, those would need to be added with either the trigger issues smart value or using the Lookup Issues action to get them first.  I recommend experimenting to confirm which is needed.

Kind regards,
Bill

Like SilkeS likes this
3 votes
Jovin
Community Champion
June 28, 2024

Hey @anne.gerten 

Automations are absolutely the right choice for this! Let's go through building this automation for you.

  1. TRIGGER: Issue created
  2. THEN: Add an action: Edit issue
    1. For the fields choose "labels"
    2. Next to the text field click on the ... then choose Copy
    3. Click on the Copy labels from Current issue and change Current Issue to Parent

Here is a screenshot too:

labels.png

0 votes
anne.gerten
Contributor
June 28, 2024

This worked for me. Thanks everybody.

jira automation.JPG

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events