Forums

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

Add sprint name to label

Josh Allen
Contributor
May 16, 2025

There are a bunch of other articles out there on this, but for some reason I'm still struggling to get it working.

I'm looking to add the active sprint name as a label on work items that have the label "release-review". 

This seems straight forward, but clearly I'm doing it wrong.

 

Screenshot 2025-05-16 at 9.43.51 AM.pngScreenshot 2025-05-16 at 9.43.56 AM.pngScreenshot 2025-05-16 at 9.44.04 AM.png

1 answer

1 accepted

2 votes
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.
May 16, 2025

Hi @Josh Allen 

What happens when your rule runs?  Please show an image of the audit log details for that rule execution.

Until we see that information...

Sprint names can contain characters which are not supported as Label values.  What do your sprint names look like?

And, the Sprint field can have multiple values when a work item has been in multiple sprints, and so the field is a list of values.  Have your work items been in multiple sprints?

Kind regards,
Bill

Josh Allen
Contributor
May 16, 2025

Ohhhh huh, do I need to somehow remove spaces so that it can be a label?

 

Screenshot 2025-05-16 at 10.56.44 AM.png

Josh Allen
Contributor
May 16, 2025

The work item sometimes does end up in multiple sprints which is why I am trying to add the label. We're trying to find release review tickets created within a specific sprint and since the sprint field can contain multiple sprints it's sometimes confusing to figure out when it was created.

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 16, 2025

Yes, and that may be done with the replace function (again assuming only one sprint name):

{{issue.sprint.name.replace(" ", "_")}}

 

Josh Allen
Contributor
May 16, 2025

Thanks Bill.

Like Bill Sheboy likes this
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 16, 2025

When there are multiple sprints, you may filter them with this expression:

{{#issue.sprint}}{{#if(equals(state, "active"))}}{{name.replace(" ", "_"}}{{/}}{{/}}

This expression iterates over the list of sprint values, using a condition to filter them, and only returning that name.

Suggest an answer

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

Atlassian Community Events