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

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

How to change a Sprint's end date via groovy or api?



Is it possible to change a sprint's end date using scriptrunner?


given a sprint name, using the script console, to change the end date for that sprint from the 9th of july to the 30th of July. 


What would also be good is if I could clear a sprint's start and end date via the console.

I'm mentioning that the sprint is not started, but it has an end date because of a synchronization done by BigPicture Gantt module which adds end dates to sprints.

Thank you!

2 answers

1 accepted

1 vote
Answer accepted
Tarun Sapra Community Leader Aug 06, 2018

You are passing "java.sqlTimestamp" instead of expected types in the method

Possible solutions: endDate(java.lang.Long), endDate(org.joda.time.DateTime),

Try something like this , there System.currentTimeMillis returns current time in long.

def newSprint = sprint.builder(sprint).endDate(System.currentTimeMillis()).build()

Please see this thread for more details.

Thank you very much, that works!

0 votes


Kindly read the following thread:

There is an idea on how to work with sprints in groovy

Tarun Sapra Community Leader Aug 06, 2018

Just to add to @Alexey Matveev _Appfire_'s answer, you can use the sprintBuilder and use the existing sprint object but set the new endDate which you want.

Set new endDate using the builder

Use existing sprint object in the builder -


Thank you for your replies.

Currently I have something that returns the sprint name and dates.

import com.atlassian.greenhopper.service.sprint.Sprint
import com.atlassian.greenhopper.service.sprint.SprintManager
import com.onresolve.scriptrunner.runner.customisers.PluginModuleCompilationCustomiser
import com.onresolve.scriptrunner.runner.customisers.WithPlugin

def sprintManager = PluginModuleCompilationCustomiser.getGreenHopperBean(SprintManager)

def sprintServiceOutcome = sprintManager.getAllSprints()

if (sprintServiceOutcome.valid) {
def sprint = sprintServiceOutcome.getValue().find { == "my_sprint_name"} as Sprint

return sprint 

I do not know how to use sprintBuilder to set a certain date. Could you please help with that?

Thank you.

Tarun Sapra Community Leader Aug 06, 2018
def sprint = sprintServiceOutcome.getValue().find { == "my_sprint_name"} as Sprint 
def newSprint = sprint.builder(sprint).endDate(<Your Date in long>).build()
def outcome = sprintManager.updateSprint(newSprint)

This should do it, above code doesn't include logging thus please add loggin as per the example link shared by Alexey 

Hi Tarun,


Thank you for your reply.


I tried the following:

def sprint = sprintServiceOutcome.getValue().find { == "name"} as Sprint
def todaysDateTime = new Timestamp((new Date()).time)
def newSprint = sprint.builder(sprint).endDate(todaysDateTime).build()
def outcome = sprintManager.updateSprint(newSprint)


No signature of method: com.atlassian.greenhopper.service.sprint.Sprint$SprintBuilder.endDate() is applicable for argument types: (java.sql.Timestamp) values: [2018-08-06 13:57:01.931] Possible solutions: endDate(java.lang.Long), endDate(org.joda.time.DateTime), name(java.lang.String), state(com.atlassian.greenhopper.service.sprint.Sprint$State)

I also tried with 

def newSprint = sprint.builder(sprint).endDate(1533556077000).build()

but it still gives the same error. 

Do you also know how the correct format looks like? 

Thank you very much!

Suggest an answer

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

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

694 views 17 19
Read article

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