Hi! I Need to get start and end dates por all Sprints in a project in Jira Cloud. I know I can get them in the bakclog, for each sprint, but I need to be able to get them all at once for an extrernal report... I don't need to be able to export to excel. It is ok to get them all at once to be able to copy and paste...
Any help will be apreciated!
Thanks a lot!
Paula
Hi @Paula Remez
Paste the following into the browser that you use for Jira and ensure that you're logged in to Jira
https://CompanyName.atlassian.net/rest/agile/1.0/board/xx/sprint
Replace CompanyName with your company name and xx with the board number of your project. This will return a JSON structure listing all sprints with their start and end dates, plus their state (open, closed).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Warren - Thank you. It works. Is there also a way to get all Sprints? Upon checking it only shows the first 50 Sprints. Thanks in advance!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Roxanne Mae Sumaya You will need to write some code to account for the pagination in the API:
Below is an example, I'm not sure if it will work for exactly your case since I have not tested if the boards API accepts a startAt and maxResults parameter
start_at = 0 sub_url = "https://CompanyName.atlassian.net/rest/agile/1.0/board/xx/sprint"
# the following url works for the example:
# sub_url = "https://CompanyName.atlassian.net/rest/api/2/search"
# Create a request object with above parameters. response = requests.request( "GET", url, headers=headers, auth=auth, params=query )
auth = HTTPBasicAuth{<username>, <password>}
headers = { "Accept": "application/json" }
query = {<any JQL parameters needed>}
all_issues = []
while(start_at < response.json()["total"]): print("starting at: ", start_at) result = requests.request( "GET", f"{sub_url}?startAt={start_at}&maxResults=1000", headers=headers, auth=auth, params=query ) issues_received = result.json()["maxResults"] start_at += issues_received print("new start_at: ", start_at) tmp = result.json()["issues"] all_issues += tmp
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.