function in jql for previous sprint

Sameer Bansal August 23, 2021

Hi Team,

Need to get a function in JIRA for getting the last closed sprint which should be OpenSprint()-1, can you share the details for this.

 

Don't want to use script runner or any other plugin for this 

4 answers

2 votes
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.
August 23, 2021

Hi @Sameer Bansal , unfortunately there while there is a closed sprints function there isn’t a “previousSprint” function. Obviously you can find previous sprint details in Reports. Is there some specific goal you are aiming for?

Sameer Bansal August 23, 2021

@Jack Brickey Actually i have created a dashboard wherein we want to compare the current sprint and previous sprint for management reporting. Right now it's a pain to change the previous sprint number everytime and if someone miss to update that then complete report doesn't make any sense 

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.
August 23, 2021

That is what I thought you might be attempting. Actually did you try this…

Sprint in openSprints(-1)

I don’t currently have any open sprints to verify this but a quick test says it might work.

Sameer Bansal August 23, 2021

@Jack Brickey  - yes, openSprints(-1) doesnt do anything just shows open sprint adding -1 or anything in the brackets doesn't seem to work. maybe its a bug or i don't know

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.
August 23, 2021

Yes that was my understanding as well. I just haven’t tested in a long time and was hoping that maybe the feature had been added but apparently not.

Like # people like this
Sameer Bansal August 23, 2021

@Jack Brickey  - so , what do you suggest it this a feature that we can expect in coming releases?

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.
August 23, 2021

I really couldn’t say. You might check on Jira.atlassian.com and see if there is already a suggestion (likely I suspect) and vote/watch.

you might consider some other work around using dates like this…

sprint not in opensprints() and resolutiondate <= startofweek() and resolutiondate > startofweek(-2w)

of course the accuracy of such a solution is short lived and you need to adjust the date parameters to align with your sprint cadence. It also nay captures issue resolved in the pas sprint.

Sameer Bansal August 23, 2021

@Jack Brickey - thanks, is there any function from which I can get the sprint start date?

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.
August 23, 2021

This is not currently possible. Here is an open suggestion - JRACLOUD-72007 

Like Andy Heinzer likes this
Sameer Bansal August 23, 2021

Thanks

Usamah zagaar March 31, 2022

I am done, I am seriously considering leaving Jira now. I thought microsoft was bad, this is beyond bad. Simple and common sense features do not exist in Jira. I am just sick of it. 

Like # people like this
0 votes
Daniel Martin June 28, 2022

I was able to achieve previous sprint using the following:

 

fixVersion in unreleasedVersions() and project = [YOUR_PROJECT_NAME] and fixVersion in releaseDate("after now() before 30d")

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.
June 28, 2022

Hi @Daniel Martin -- Welcome to the Atlassian Community!

I do not see the releaseDate() in out-of-the-box JQL functions.  Are you using a marketplace addon to provide that feature?

Kind regards,
Bill

0 votes
Curt Holley
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 1, 2022

Further to @Bill Sheboy suggestions, if you are happy to receive whatever info it is you are after via email (from an automation rule), I've just got this working to report on the mentioned issue types in the JQL for the sprint that triggered the rule to run, by using the {{sprint.id}} smart value in the JQL.

Screenshot 2022-06-02 124549.png

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.
August 23, 2021

Hi @Sameer Bansal 

Yes, and...to what Jack notes: there is nothing built-in to do this yet.

As a work-around, you could use the built-in automation rule features to help in a few ways:

  1. Use an automation rule which automatically updates your dashboard filter (using the REST API) when a sprint completes, shifting the filter to use the new "previous" sprint id
  2. Or, add custom fields and devise a mechanism where you can distinguish the current and previous sprint, and set the custom fields with an automation rule.  Your filters could then remain stable to support reporting/dashboards

Best regards,
Bill

Sameer Bansal August 23, 2021

@Bill Sheboy  - 

1) for REST API an not sure what will be the trigger point for the automation rule 

2)  for option 2 the requirement is to distinguish the current and previous sprint

  • i am checking if i can device a formula where i can subtract the name of sprint by 1
    • example Current sprint name is "ABC  2" so somehow i can do "ABC 2-"1" " or something like that 
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.
August 23, 2021

For option 1, you could trigger the rule on sprint completed.

Sameer Bansal June 15, 2022

it didnt worked, so i discarded the idea will check in future if reqired

Suggest an answer

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

Atlassian Community Events