It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Get latest sprint name from Epic stories

Hi,

Using groovy or scriptrunner, I want to get the latest sprint name that has longest timeline or close at last.

Lets say, EPIC-1 stories are distributed in 3 sprints with different end date.

Epic 1:

-sprint 1 - Timeline: 10-28-2019 to 11-15-2019

--- Story1

--- Story2

-Sprint 2 - TImeline:  11-04-2019 to 11-12-2019

--- Story1

--- Story2

-Sprint 3 - TImeline:  11-04-2019 to 11-29-2019

--- Story1

--- Story2

The script should return "Sprint 3" name. I able to find the sprint name and date value for each sprint but i not sure how to compare date for each sprint and get the latest sprint date.


Thanks,

1 answer

0 votes

Assuming your sprints are in an array, you could just sort them.

def lastSprindByEndDate = sprints.sort{it.endDate}.last()
def lastSprintName = lastSprintByEndDate.name
def lastEndDate = lastSprintByEndDate.endDate

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

273 views 1 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you