2

I am creating a C# tool that pulls information from YouTrack using the REST API. I am looking for a way to get a list of the sprints that have been created. Is there a way to easily get this information through the REST API? Worst case I could get the list of issues and parse through all of them to collect all of the available sprints, but there has to be an easier way.

Sarah
  • 328
  • 1
  • 6
  • 15

4 Answers4

4

Version 5 changed the agile method. The new agile method is returned with the following command:

{baseUrl}/rest/agile/{agileID}/sprints

I had to get the list of the Agile ID's to use in the above url using the following command:

{baseUrl}/rest/agile/agiles

This now gives a list of all the agile boards and using the 'id' element in the first command above will return the list of sprints for that agile board. The AgileID's are returned something like 'myprojectname-99'. I found that if you just use the numeric number at the end of the ID, that will also work instead of using the full agile name.

Mike
  • 182
  • 1
  • 11
2

I found a much simpler way to get the sprints:

{baseUrl}/rest/agile/{projectName}/sprints?"

This gives an XML with all of the sprints for that project and their start/end dates.

Sarah
  • 328
  • 1
  • 6
  • 15
  • 1
    +1 you are awesome! Been looking for this for start and end dates ^^ Too bad they're pretty-printed... – Oskar Duveborn Mar 07 '13 at 08:45
  • Wondering how you found this. The only reference to this API that I can find is in this question on SO. Thanks! – Joe Castro Sep 13 '13 at 17:55
  • And I found the same thing by watching what requests the real YouTrack UI is making. There are a few being made with the /rest/agile path, but not many that are usable externally... – Joe Castro Sep 13 '13 at 18:13
  • 1
    The only real reference I saw was [this](http://confluence.jetbrains.com/display/YTD3/YouTrack+REST+API+Reference) from JetBrains. However, there was a little trial and error as well because, as you will notice, it is incomplete. You can also search for general REST API help because it can be applicable depending on what you are looking for. – Sarah Sep 16 '13 at 13:28
1

What you request can be obtained by GET {youtrac.base.url}/rest/admin/customfield/versionBundle/{bundleName}. To find out {bundleName}, go to agile settings and have a look at 'Field to identify sprints:' setting which gives you the field name. For this field, in Administration you can locate the name of the bundle.

Alex.V
  • 2,081
  • 14
  • 13
  • How would one get the start and end date of a sprint? It only gives me the actual release version information.. – Oskar Duveborn Mar 01 '13 at 14:40
  • The REST resource mentioned above will return a collection of bundle elements. Each has a releaseDate. AFAIU, this is what you're looking for. – Alex.V Mar 04 '13 at 13:58
  • No it's not the releasedate, that's not the same as the start and the end date of a sprint? – Oskar Duveborn Mar 07 '13 at 08:45
-2

{baseUrl}/rest/agile/{projectName}/sprints? is only working if the name of the agile board is the same as the projectName!!!

The API is: {baseUrl}/rest/agile/{agileName}/sprints?

Ethaan
  • 11,291
  • 5
  • 35
  • 45
CeeGee
  • 1
  • This is more of a question than an answer. If you have a question, please ask it by clicking the [Ask Question](http://stackoverflow.com/questions/ask) button. You can also favorite this question to be notified of any updates, including answers. – ryanyuyu Apr 03 '15 at 22:19