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

There is no rest api call to create sprint in version2 documentation

Hari Gudladona December 16, 2017

there is no rest api call to create sprint version2 documentation

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 4, 2018

I am somewhat confused here.  This post is labeled as Jira Service Desk, but you appear to be asking questions on creating a sprint.  That is specifically a function that is provided by Jira Agile/Jira Software.  You are correct that the Jira Service Desk REST API cannot create a sprint.

You can create a sprint via a REST API call, but you will need to have Jira Software or Jira Agile (in Jira 6.x and older versions) to be able to do this.  I would recommend checking out the Jira Server Agile 7.3.1 REST API reference page or conversely the Jira Software Cloud REST API page for more details on how you can do this.

Jirong Hu October 24, 2019

Doesn't work for me, no result, no response. It's JIRA Cloud v8, tried the same on a local JIRA server v8, same.

C:\DevOps>curl --insecure --request POST --url "https://abc.com/rest/agile/latest/sprint" --user "jironghu:jironghu" --header "Accept:application/json" --data '{"name":"Jirong1","originBoardId":283}'

C:\DevOps>
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 25, 2019

I tested this against both Jira Cloud and Jira server today. It still works, but the endpoint your using is not what is currently documented in either of the links above I referenced.  In those they are using /rest/agile/1.0/sprint  However you appear to be using 'latest'.  Perhaps that is a factor here.

Testing in my Jira Cloud site:

user$ curl --request POST \
> --url 'https://[redacted].atlassian.net/rest/agile/1.0/sprint' \
> --header 'Authorization: Basic [redacted]' \
> --header 'Content-Type: application/json' \
> --data '{ "name": "Sprint Created by REST!!", "originBoardId": 1}'
{"id":22,"self":"https://[redacted].atlassian.net/rest/agile/1.0/sprint/22","state":"future","name":"Sprint Created by REST!!","originBoardId":1}
user$


And again in Jira Server 8.4.2, but this time with basic auth (just username and password)

user$ curl --request POST \
> --url 'http://localhost:8842/rest/agile/1.0/sprint' \
> --user admin:password \
> --header 'Content-Type: application/json' \
> --data '{ "name": "Sprint Created by REST!!", "originBoardId": 1}'
{"id":3,"self":"http://localhost:8842/rest/agile/1.0/sprint/3","state":"future","name":"Sprint Created by REST!!","originBoardId":1}
user$

In both cases, it created a new sprint on that board for me.  Atlassian Cloud deprecated the use of plaintext passwords for basic auth REST calls back in June of this year. More details in Deprecation notice - Basic authentication with passwords and cookie-based authentication.  But you can still create a REST API token, then base64 encode a string of your emailaddress:API_Token, and pass that as a header in the call.  More details on doing that in Basic auth for REST APIs.

I'm not sure why you would be getting no response whatsoever from this call.  Perhaps the curl client on your windows machine is out of date.  Perhaps updating from the developers site in https://curl.haxx.se/windows/ might help to get back some kind of response from Jira when making a request these endpoints.

Andy

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events