I'm trying to write a plugin for TFS 2015 (its important). I read a couple of manuals. the examples all turns out simply, but it is more difficult with a real plugin. my problem: -How do I get all the teams that the user member is
i can get current team from web context:
var context = VSS.getWebContext();
var currTeam = context.team;
but how can i get all avaible teams and groups for current user(or by id)?
You could get the teams through this method getTeams() directly
IPromise<Contracts.WebApiTeam[]> getTeams(projectId, top, skip)
It's not able to do this through js or rest api for now. You could either use tfs command to list the info or use TFS API to achieve what you want. Related method in API: List application groups()
, readidentities()
Detail code please refer this question: How to get TFS user groups and users in particular group using TFS API?
Another script solution you could also take a look, just in case you are interested: Using PowerShell and TFS API to list users