create sprint using greenhopper with custom name

R S April 16, 2015

hi

I need to create a Sprint in my Sprint board using the Green hopper REST Apis. I am able to create new Sprints using the following :

curl -u <user>:<pass> -X POST -k -H "Content-Type: application/json" -d "{\"name\" : \"foobar\"}"

https://<jira-host-name>/rest/greenhopper/1.0/sprint/1429

*1429 is the rapid board id.

The problem is the Sprint name. I see the new Sprints are created by names as "Sprint-1, Sprint-2...and so on".

How can I create a Sprint with a custom  name. (foobar - in this example)

Please help.

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
rsperafico
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 17, 2015

Hello R S,

Thank you for your question.

Please, refer to https://jira.atlassian.com/plugins/servlet/restbrowser#/resource/greenhopper-1-0-sprint-sprintid for further information. (Note: disable "Show only public APIs")

# [USERNAME], i.e.: myuser
# [JIRA-BASE-URL], i.e.: http://my.company.domain
# [SPRINT-ID], i.e.: 8
curl -u [USERNAME] -p -H "Content-Type: application/json" -X PUT -d '{"name":"foobar","startDate":"17/Apr/15 10:20 AM","endDate":"18/Apr/15 12:00 PM"}' [JIRA-BASE-URL]/rest/greenhopper/1.0/sprint/[SPRINT-ID]

In case you are running JIRA under HTTPS protocol, please run the cURL command as per following:

curl -D- -u [USERNAME] ...

In the above call, you will be prompted to type in the password to the [USERNAME] given, in this case the password for user "myuser". Alternatively, you could call as per following avoiding to be prompted for password:

curl -u [USERNAME]:[PASSWORD] -H "Content-Type: application/json" ...

If you find this answer useful, I would kindly ask you to accept it so the same will be visible to others who might be facing the same issue you have inquired.

Thank you for your understanding.

Kind regards,
Rafael P. Sperafico
Atlassian Support

R S April 17, 2015

Please confirm if my understanding is correct. In order to create a new Sprint, i need to follow two steps : 1. Use the api ( as in my original question) to create a new sprint. I will get the newly created sprint's Id as part of the response. 2. Use the api as suggested by you to update this sprint with name, dates etc with the sprint id obtained from step 1. We need to make two calls to create a Sprint with custom name and details.

0 votes
R S April 16, 2015

I also want to provide start date and end dates (other than name) as input parameters to this REST call.

TAGS
AUG Leaders

Atlassian Community Events