Search code examples
azure-devopsazure-devops-rest-api

How do I add a Sprint using the Rest API


Within the Azure DevOps Rest API I want to be able to add a Sprint programmatically.

I'm having trouble understanding how to accomplish this because it seems the documentation states I needed id before I can add at iteration.

Can someone please help me to understand what request I need to compose to create a new iteration via the API?

https://learn.microsoft.com/en-us/rest/api/azure/devops/work/iterations/list?view=azure-devops-rest-5.1


Solution

  • The id that you need to provide in the body is the Classification Node Identifier, you can fetch the list from this API:

    GET https://dev.azure.com/{organization}/{project}/_apis/wit/classificationnodes/{stractureGroup}/{path}?api-version=5.1
    

    The structreGroup is Areas or Iterations (in your case it should be Iterations).

    In the response you will get a identifier property with a GUID, use this GUID for the id in the create iteration API.