Date from the latest sprint from an issue

Bartlomiej Bukowski September 22, 2023

Hi,

I am wondering how I can get endDate from the newest spring assigned to the issue?

 

I have an automation which updates Issue `Due date` when new sprint is added to the issue.

{{issue.Sprint.endDate.minusDays(1).jiradate}}

Problem is that issue can have more than one sprint and that smart value return endDate from the oldest Sprint.

2 answers

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

Hi @Bartlomiej Bukowski 

Until a sort option/function is added to lists, we cannot rely upon first and last for a scenario like yours.  (The exception is when you do have a sort, ORDER BY, for things like lookup issues with JQL.)

For your scenario, let's assume your newest sprint is the one which ends the latest.  If that is the case, you can use this:

{{issue.Sprint.endDate.max}}

If that does not work for some reason, there is a much more elaborate work-around, using a REST API call and smart value, list filtering.  Hopefully you will not need that one  :^)

Kind regards,
Bill

Bartlomiej Bukowski September 25, 2023

Hi Bill,

Thank you for your support.
Your suggestion solved my issue.

Smart values used by me:
- for start date:
{{issue.Sprint.startDate.max.jiradate}
-for end date:
{{issue.Sprint.endDate.max.minusDays(1).jiradate}}

Best regards,
Bart

Like Bill Sheboy likes this
1 vote
Jack Brickey
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

Hi @Bartlomiej Bukowski , try using the "last" function.

{{sprint.endDate.last.minusDays(1).jiraDate}}

Bartlomiej Bukowski September 22, 2023

Hi Jack, 

I tried both

{{issue.Sprint.last.endDate.minusDays(1).jiradate}}
and

{{sprint.endDate.last.minusDays(1).jiraDate}}


It will give different date but not from the current sprint.

Example:
- Issue has already Sprint1 and Sprint2 set up
- Adding Sprint3
- DueDate set on issue changes to the date from Sprint2 and not from Sprint3.

Old smart value which is

{{issue.Sprint.endDate.minusDays(1).jiradate}}
will set up DueDate from Sprint1

There is a progress but it's not the solution yet.

Suggest an answer

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

Atlassian Community Events