JQL for last close Sprint

Manikandan K November 7, 2017

Please let me know do we have any function to retrieve the values from previously closed Sprint using the script runner ?

2 answers

1 accepted

4 votes
Answer accepted
Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2017

The following function should be able to help you to

previousSprint

previousSprint(board name)

Shows issues that are members of the last completed sprint.

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2017
Manikandan K November 7, 2017

Thanks Tarun

When i use below query it returns the value

 issueFunction in aggregateExpression("Total Estimate for all Issues", "originalEstimate.sum()", "Remaining work", "remainingEstimate.sum()")  and sprint in (126)

 

But not for this one. What did i miss in my JQL

 issueFunction in aggregateExpression("Total Estimate for all Issues", "originalEstimate.sum()", "Remaining work", "remainingEstimate.sum()")  and issueFunction in (previousSprint("Olympians Board for Story (AA + BB+ CC+DD)"))

 

I dont want to update the query every Sprint

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2017

What is returned by 

issueFunction in previousSprint(<your board name here>)
Like lkao likes this
Manikandan K November 7, 2017

When i run this query 

 

issueFunction in (previousSprint("Olympians Board for Story (AA + BB+ CC+DD)")

 

I get no issues found. Is anything wrong in it ?

Tarun Sapra
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 7, 2017

Are you entering the correct board name as you have to just enter the board name and whats "AA , BB, CC, DD" . What kind of naming is this?

Also please validate in the board that you have an closed sprint in the board as the "previousSprint" returns issues from last closed sprint.

Manikandan K November 7, 2017

I have updated the board name  with below 

issueFunction in (previousSprint("Olympians_Board_for_Story"))

Still it shows no issues found. I have reports and velocity chart being populated for this board

If the board name is incorrect it throws an error message. It seems to be an issue with script runner 

Like Florian Hoffmann likes this
Manikandan K November 7, 2017

I found the issue in my jql. 

 

When i exclude "(" in front of the previous sprint it worked. Thanks Tarun

 

issueFunction in previousSprint("Olympians_Board_for_Story")

Tarun Sapra November 7, 2017

Good to know that it's now working. Please upvote/accept the answer if it works for you.

Manikandan K November 7, 2017

Thanks. I did.

Wilson Faure October 23, 2020

I tried this but did not work for me. do I need to have those functions enabled in my Jira install? we use JIra server version

Like # people like this
Muhammad Waqas Osmani November 19, 2021

@Tarun Sapra 

when I write my query, I get this reponse:

Unable to find JQL function 'previousSprint()'.

Like # people like this
Omar.Samad November 19, 2021

same for me. I guess we will need to use some jira Ad-Ons to have these functions?

0 votes
Omar.Samad November 17, 2021

when I write my query, I get this reponse:

Unable to find JQL function 'previousSprint()'.

Dave F November 21, 2021

previousSprint() is an Adaptavist Scriptrunner plug-in function.  See the link just under the Answer text above

Suggest an answer

Log in or Sign up to answer