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

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

3 votes
Jovin
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 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

Suggest an answer

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

Atlassian Community Events