Forums

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

Add a label to any issuetype inside of a specific Epic

Sara Chaves March 13, 2025

Hi, I would like to create a rule, in order to when I create a ticket of any issuetype, and the parent of that ticket is a specific Epic, I want to add to the ticket a specific label. 

How can I do that?

1 answer

1 accepted

3 votes
Answer accepted
Trudy Claspill
Community Champion
March 13, 2025

Hello @Sara Chaves 

Have you tried to create this Automation Rule? If so, please show us what you have so far.

Do you have any experience with creating Automation Rules? If you have little or no experience with this feature I encourage you to take advantage of the free, on-demand training available from Atlassian University, You can find topics with this search:

https://university.atlassian.com/student/catalog/list?search=jira+automation

The documentation for Automation Rules is here:

https://support.atlassian.com/cloud-automation/docs/jira-cloud-automation/

The basic structure of your rule would be:

TRIGGER: Issue Created

CONDITION: Related issues condition
Related issues: Parent
Condition: Matches specified JQL
Matching JQL: key = insert issue key for the Epic

ACTION: Edit issue
Select the Labels field
specify the Label value to add

Sara Chaves March 14, 2025

I yes I have already been creating automation rules, and I followed that basic strutucture. 

My problem here is that is what is the issueKey for that specific epic? 

I tried with Epic Name = Epic Name but it didn't work.
Here is what I did:

Screenshot 2025-03-14 at 08.48.37.png

Trudy Claspill
Community Champion
March 14, 2025

The issue key for any issue is the ABC-123 identifier for that issue.

Screenshot 2025-03-14 at 7.21.45 AM.png

 

Below the JQL field in the Related Issues Condition there is a Validate query feature. If you click that do you get any results for your current JQL?

If you change the JQL do to what I suggested do you get any results from the Validate feature?

With your rule as it currently is, what information is written to the rule execution Audit Log when the rule executes?

Sara Chaves March 14, 2025

it worked thanks a lot

Like Trudy Claspill likes this
Trudy Claspill
Community Champion
March 14, 2025

You're welcome!

If my response helped you solve your requirement please consider clicking on the Accept Answer button to mark your Question as Solved.

Sara Chaves March 14, 2025

Also another question, is it possible in the same rule, say that I want to apply this to any issue created and to the issues that already exist in the epic?

Trudy Claspill
Community Champion
March 14, 2025

The rule is currently triggered by Issue Created, so it will run for each newly created issue.

You could also, within this rule, review all the issues under the same parent Epic to make sure they have the Label if it should be there. To do that you would add a For Each: Related Issues: JQL step. Use that step to find and iterate over all the issues that have the same Parent as the trigger issue.

Screenshot 2025-03-14 at 8.21.30 AM.png

 

If you wanted to evaluate all the existing child issues for a set of existing Epics then you could use a rule that uses a Scheduled trigger and use a JQL in that trigger to lookup all the issues in a specified set of Epics:

parent in (ABC-123, ABC-456, ABC-789)

Then use the same condition and action used in your existing rule to update the child issues found.

 

Sara Chaves March 28, 2025

Thanks it worked, but I there was also an issue. 


When adding the new label to the tickets that were already in the EPic its removing the other labels of the ticket, what change I need to do, to maintain the labels that were already in the tech and adding a new one?

Trudy Claspill
Community Champion
March 28, 2025

In the Edit dialog, next to the Labels field click the button with three dots and choose ADDREMOVE. That will give you two fields for specifying values you want to add and values you want to remove.

Screenshot 2025-03-28 at 7.30.58 AM.pngScreenshot 2025-03-28 at 7.31.43 AM.png

Like Bill Sheboy likes this
Trudy Claspill
Community Champion
March 28, 2025

If my response helped you solve your requirement please consider clicking on the Accept Answer button to mark your Question as Solved.

Suggest an answer

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

Atlassian Community Events