Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Store Active Sprint in New Field? Using Jira Automation, Script Runner, or Both?



If you look at the way Jira stores sprint information you will soon see it's quite complicated. Jira likes to save all completed sprints as an array along with the current sprint information which makes it really hard to pull out that one specific value. I am close to making this happen with Jira Automation, however, it falls short in the scenario below. So I included Adaptavist as well to see if this is possible or how to go about it with Script-Runner (we own both products).

It is also a shame because at the moment {{issue.sprint.last}} works most of the time, but since sprints are served up based on ID and not sequence, the sprints don't always line up in the correct order for which they've been ran.


To save the active sprint name value (or any part of the list, please make it flexible) into a new field.


Privacy information has been removed.

"customfield_10105": [
name=Sprint1 21.2.2 (4/29-5/19),
name=Sprint2 21.2.3 (5/20-6/9),
name=Sprint3 21.2.1 (4/8-4/28),


In the example above you can see the second sprint in this list is actually the most current, the state is active, the sequence number is higher, the start and end dates are closer, but the ID seems to be determining the order (which does make sense to me). This might be more of an edge case where this person changed the name of a sprint and then ran them out of the order they were created in.

Even though this is an edge case (maybe) it is what I am currently dealing with, and we should be able to get that value without this much hassle. I look forward to the responses.


I currently have an IF-ELSE automation that looks to see if the sprint is empty, and if it is then it sets our custom field to backlog, same if the sprint not in openSprints() or futureSprints(). The last else just updates the field with {{issue.sprint.last}} and this mostly works except for most issues that have, "completed sprints" associated to them.


I thought about building a listener or some type of script but honestly I have no idea where or how to even start, I'm not familiar with groovy or importing methods to use so a lot of help would be appreciated here.

4 answers

1 accepted

2 votes
Answer accepted
Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 24, 2022

@Benjamin Dains - I was working on something similar recently - on Jira Data Center.

See if this works for your use case:




When I ran the rule, "Sample Sprint 4" was the active (open) sprint, and "Sample Sprint 2" was closed a while ago.

Note that this solution will work regardless of the order sprints are listed in the "Sprint" field.

Note that this solution may return multiple active/open sprints. I did not test that case.

Here's the magic in text form:


For those using Jira Cloud, there's a related solution here:

@Mykenna Cepek I just wanted to circle back and say thanks for this post. It works brilliantly. I actually don't need it for what I originally posted for, but turns out I do need it for something completely different!

So I just wanted to say thanks and I've accepted this as the correct answer. At the time of the writing I didn't really know how to iterate over an array using Jira Automation but now I do! :)

Like Bill Sheboy likes this
0 votes
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 21, 2021 • edited

Hi @Benjamin Dains 

How much scope change do you have during sprints?  If the answer is "none" or "not much", have you considered using the Sprint Started trigger, and saving that sprint value in your custom field?

If you have a lot of scope change, a messier solution would be to use a web request to call the REST API to get all of the issues in the sprint.  That seems a bit heavy to solve this problem.

Best regards,


Hi @Bill Sheboy !

Sorry for the long delay, we decided to turn off the automation since there really isn't a good way to get the value 100% of the time and was causing more confusion than value.

The scope does change often or else that does seem like a viable solution.


0 votes
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 18, 2021

I've managed to accomplish this through some trail an error. It's not as flexible as you've requested, I'll leave that as an exercise for the reader.

The basic gist is to use a combination of smart value list interpolation and create variable action to print out and then extract the active sprint name. Grabbing any other value from the active sprint object would also be possible. Your question indicates that you know how to lookup the values within said object so I'll skip that explination.

Here are screenshots of what you want:


Create a variable to store the sprint names and state information as a string.Screen Shot 2021-05-19 at 11.20.48 am.pngLog our regular expression to be sure it extracts what we expect.

Screen Shot 2021-05-19 at 11.20.55 am.png

Create another variable with the extracted active sprint name as a string.Screen Shot 2021-05-19 at 11.21.01 am.png

Add a comment to an issue, just to be sure we can actually use this information in some meaningful way.Screen Shot 2021-05-19 at 11.21.07 am.png

A look at the resulting audit log.Screen Shot 2021-05-19 at 11.25.08 am.png

The comment was successfully added.

Screen Shot 2021-05-19 at 11.21.11 am.png

@wwalser thanks a bunch for that help, I really appreciate it. I think the only problem that I have here is since we're on Jira Data Center, our Jira Automation doesn't give me the option to create a variable (which is extremely unfortunate). 

Is this example you've typed up related to Cloud?

Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 19, 2021

Ah yes, very sorry about that. This will not work on server. Unfortunately I'm not sure you'll be able to accomplish this on Automation for Jira server.

No problem, thank you for your help! :)

Bump to see if anyone has any ideas or help. :)

Mykenna Cepek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 24, 2022

See my post this date (above).

Like Oğuz Kaan Baysal likes this

Suggest an answer

Log in or Sign up to answer