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

Jira Automation - Adding Label to New stories added to an Epic

Anu September 22, 2023

Hello, Am trying to add Jira Automation rule. My scenario is - Whenever a new story is added to an Epic, it automatically adds Label same as Epic Name. 

 

For ex: Epic summary and Name are same - "Project ABC" 

Anytime a user adds a new story under the epic "Project ABC", same label gets added to newly created story as "Project ABC" 

 

any help is much appreciated. thank you 



 

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2023

Hello @Anu 

Welcome to the Atlassian community.

Have you tried to construct this rule?

Can you show us what you have so far, and let us know where you are struggling?

Are you working with issues in a Team Managed project or a Company Managed project?

Anu September 22, 2023

Thanks for the quick response. So far I have just tried as shown in screenshot below. 
Am checking when Any issue is created, and IssueType is Story, and Epic Name start with " project ABC" Then Edit issue Fields, and selected Labels  value

 

Upon further digging I realized, any new story created does not have Epic Name as fields but only Epic Link. So hence my automation fails at that step. Couldnt figure out how to get capture Epic Name and mark it is as Label for any new story created. 

hopefully that help explain what i have done so far. 


also, this is Company Managed Project 

Screenshot 2023-09-22 at 6.08.22 PM.png

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 22, 2023

We need to back up a moment and look at the problem you are trying to solve with this automation.

Why are you trying to add the Epic Name value from the parent Epic as a Label on the child issue?

If you Epic Name value has spaces in it, it cannot be added as a Label value. Label values can't have blank spaces.

Additionally, Atlassian is in the process of deprecating the Epic Name field.

So, I think we should re-examine the problem you are trying to solve and consider if there is a better solution.

Like • Bill Sheboy likes this
Anu September 26, 2023

Hi Trudy, 

As you rightly mentioned above, the use case am trying to accomplish here is to add the Epic Name value from the parent Epic as a Label on the child issue so that when the child issue gets moved from Original Epic to a New epic for next PI OR diff team, it will retain the previous Epic Name in form of label for the Jira dashboard reports. 

This is to avoid lot of manual updates to each ticket with Label names. 

Problem: The teams are using 5 Epics (IssueTypes) which doesn't gets closed for the year for Ex: Prod Support, Tech Debt, and few other lets say Epic 1, Epic 2, Epic 3 . For each PI, we have PI specific Epic, where teams would like to pull in planned tech debt items, Prod support or enhancements, so we know going into PI who much work we can accomplish from the original bucket of 5 Epics. 
In order for teams to differentiate what are different what were different types of stories pulled into PI specific Epic, labels are leveraged.  

Am trying to see if I can automate naming Labels.  

Hopefully that helps explain the use case am trying to accomplish. 

To answer other questions: 

1. The blank spaces in epic name as label, realized when creating labels. Thanks for confirming the same. 




Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 27, 2023

Why not just use the Epic issue key as the Label value instead? Or create a custom field (issue picker) where you add the Epic issue key?

As I mentioned the Epic Name field is in the process of being deprecated. Eventually, at some unknown future date, that field may no longer be available. Additionally somebody could change the name of your Epic after it has already been used to create a Label, which would then create a mismatch.

If you are set on using the Epic Name regardless of the above, you are going to have to replace the blank spaces in the value with non-blank characters before it can be added to the Labels field. Here is an example of replacing the blank spaces with dashes.

{{issue.epic.epic name.replace(" ","-")}}

Screenshot 2023-09-27 at 1.07.17 AM.png

Like • Anu likes this
Anu September 27, 2023

reason for not using Epic Issue key as Label because this process is limited to only 5 epics in the project to start off with. 

with Epic Name being deprecated in future, perhaps it is time take a step back to look at overall process and see if there is any other better way as there seems to be lot of restrictions in current project space which is being used by multiple teams and one change in fields will impact other projects due to same workflow been used for mutiple projects instances. 

thank you for the patience with me in answering above questions. 

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.
September 27, 2023

Hi @Anu 

Adding on to Trudy's suggestions...

It seems you are using epics for two purpose: organize a large work item and classify work types (i.e., Prod Support, Tech Debt, etc.)

Have you considered using something else for the classification of work, such as the Component field?

Kind regards,
Bill

Anu September 27, 2023

Hi Bill,  that is right - Am trying to organise the backlog  in a meaningful way with existing setup and process in place.  As part of it, looking at ways if something can be placed in automation.

Teams are leveraging 'Component' field to differentiate  multiple Teams working in same larger project. 

I wish "Teams" functionality  in Jira was leveraged to differentiate teams :) 

None the less, 

Lewis Cook
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.
November 1, 2023

Hi @Anu 

 Just reading up on this thread.

We've been using "Teams" within our confluence space which facilitates a "Team" field in Jira. I've setup filters for our sprint teams to only include issues assigned to their specific team as we use projects to represent our various products in development. So a teams board filter becomes "Project in (A, B, C) and team = "Your Team Name".

I also have the "Teams" option at the top of my Jira instance (we are on cloud). So assuming you might be able to add that to the process you were attempting to setup.

Thanks

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
atlassian, team '25, conference, certifications, bootcamps, training experience, anaheim ca,

Want to make the most of Team ‘25?

Spend the day sharpening your skills in Atlassian Cloud Organization Admin or Jira Administration, then take the exam onsite. Already ready? Take one - or more - of 12 different certification exams while you’re in Anaheim at Team' 25.

Learn more
AUG Leaders

Upcoming Jira Events