2
votes

I have Azure DevOps extension which is based on typescript. My extension supports TFS 2015, 2017,2018,2019 and Azure DevOps. I am trying to get list of "Team" names, during run time to use in my extension.

I can download "Team" list using witadmin command

    witadmin exportgloballist 
    /collection:http://localhost:8080/tfs/DefaultCollection 
    /f:C:\tfs\download\globallist.xml

    <GLOBALLIST name="Teams">
        <LISTITEM value="a" />
        <LISTITEM value="b" />
        <LISTITEM value="c" />
        <LISTITEM value="d" />
        <LISTITEM value="e" />
        <LISTITEM value="f" />
        <LISTITEM value="g" />
     </GLOBALLIST>

I have gone through below Microsoft TFS API reference with the objective to obtain "Team" names using TFS API. Oldest API reference I found in this doc is version 4.1. I was looking for older version of API reference but it seems those details are not documented.

https://docs.microsoft.com/en-us/rest/api/azure/devops/core/teams/get%20all%20teams?view=vsts-rest-tfs-4.1

Provided API call in the above doc, does work fine with Azure DevOps.

However, it does not works with TFS versions. in TFS 2017 it just displays "page not found" error.

e.g.

https://testing123.visualstudio.com/_apis/teams?$mine=True&api-version=4.1-preview.2

Please be kind enough to provide some guidelines to obtain "Team" name list on TFS 2015 and other TFS versions using TFS API call.

1

1 Answers

2
votes

The documentation for the older versions of the API are separated and can be a little confusing to find. They can be found at this link (which has a breadcrumb on the overview of the current API spec).

That being said, I don't think there is a documented API for the older versions that will get the teams for you like you are wanting. Inspecting the network traffic though when browsing teams, it looks like this (probably unsupported) API is available to use in TFS2015 - AzDO2019.

http://{instance}/{collection}/{project}/_api/_browse/GetTeams?__v=5