1
votes

I think there is a problem with the new TFS REST API. Let me explain :

Here is an example of a classification node, which is basically an "inactive" iteration (not shown with the other sprint in TFS) :

{
  "id": 126391,
  "name": "Web",
  "structureType": "area",
  "hasChildren": false,
  "_links": {
    "self": {
      "href": "https://fabrikam.visualstudio.com/DefaultCollection/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/classificationNodes/Areas/Web"
    },
    "parent": {
      "href": "https://fabrikam.visualstudio.com/DefaultCollection/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/classificationNodes/Areas"
    }
  },
  "url": "https://fabrikam.visualstudio.com/DefaultCollection/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c/_apis/wit/classificationNodes/Areas/Web"
}

Pay attention to the "id" field. It's not a TFS GUID, it's a basic id.

Now, here is what you need to send to the API to append your classification node to a team, which is the way to active your classification node as an iteration :

POST https://{instance}/DefaultCollection/{project}/{team}/_apis/work/TeamSettings/Iterations?api-version={version}

"{\"id\":\"a589a806-bf11-4d4f-a031-c19813331553\"}"

This is the problem ! You need the GUID of your classification node to append it to a team but there is no way to retrieve it...

Can someone explain me how is it possible ? Thanks in advance.

EDIT 6/24/2016 Here's what I retrieve when I'm asking for all the classification nodes :

https://{...}/_apis/wit/classificationNodes/iterations?$depth=2

Classification nodes tree

2

2 Answers

1
votes

I can get the GUID of the iterations/areas via Rest API. Can you retry and provide your steps if you can still see the issue?

enter image description here

-1
votes

Look at the published API document below, I think its what you need.

https://www.visualstudio.com/en-us/docs/integrate/api/tfs/projects

GET https://{instance}/DefaultCollection/_apis/projects?api-version={version}[&stateFilter{string}&$top={integer}&skip={integer}]

Example https://fabrikam.visualstudio.com/DefaultCollection/_apis/projects?api-version=1.0

   {
  "count": 3,
  "value": [
    {
      "id": "eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
      "name": "Fabrikam-Fiber-TFVC",
      "description": "Team Foundation Version Control projects.",
      "url": "https://fabrikam.visualstudio.com/DefaultCollection/_apis/projects/eb6e4656-77fc-42a1-9181-4c6d8e9da5d1",
      "state": "wellFormed"
    },
    {
      "id": "6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
      "name": "Fabrikam-Fiber-Git",
      "description": "Git projects",
      "url": "https://fabrikam.visualstudio.com/DefaultCollection/_apis/projects/6ce954b1-ce1f-45d1-b94d-e6bf2464ba2c",
      "state": "wellFormed"
    },
    {
      "id": "281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
      "name": "TestGit",
      "url": "https://fabrikam.visualstudio.com/DefaultCollection/_apis/projects/281f9a5b-af0d-49b4-a1df-fe6f5e5f84d0",
      "state": "wellFormed"
    }
  ]
}