Get teams I am member of

715 views Asked by At

I want to retrieve all teams in a specific TFS team project where I am member. Is this possible with the REST Api?

I know that you can fetch all teams, for each team the members and then sort all teams out where I am not a member.

Is it possible to just fetch the teams that I am a member of?

1

There are 1 answers

0
PatrickLu-MSFT On BEST ANSWER

For REST API, it's impossible to directly fetch the teams that a specific be a member of.

You could only get all teams within the project that the authenticated user has access to. Then get a list of identity references for the team's members. At last fetch the teams that you are a member of.

Related API and code sample please refer this link Teams.

Unless that the teams you are not the member of , you also don't have the corresponding permission to access it. You could simply use below Rest API, since the API will get all teams within the project that the authenticated user has access to.

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