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

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

there is no rest api call to create sprint version2 documentation

1 answer

0 votes
Andy Heinzer Atlassian Team Jan 04, 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.

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 Oct 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:

aheinzer:~ aheinzer$ 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}
aheinzer:~ aheinzer$


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

aheinzer:~ aheinzer$ 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}
aheinzer:~ aheinzer$

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
Community showcase
Published in Jira Service Desk

The Complete Guide to Atlassian for ITSM

Hi Atlassian Community! This is Teresa from the Atlassian team. My colleague Paul Buffington @Buff and I are excited to share a brand new ITSM resource we’ve created – "The Complete Guide to At...

972 views 7 15
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