我是我公司的VSTS帐户的管理员。我不时需要映射用户和项目,即列出特定用户所属的项目。徒劳无功,我看过很多VSTS的角落和缝隙,并搜索了在线文档。我很感激任何建议。VSTS列出用户参与项目
0
A
回答
1
0
另一种方法是,你可以实现通过客户端SDK。
有简单的样品,以获得为您具体可以参考用户团队:
TfsTeamProjectCollection collection = new TfsTeamProjectCollection(new Uri("[collection url]"));
collection.EnsureAuthenticated();
var structureService= collection.GetService<ICommonStructureService>();
var teamprojects = structureService.ListAllProjects();
TfsTeamService teamService = collection.GetService<TfsTeamService>();
UserInfo user = new UserInfo();
foreach (var tp in teamprojects)
{
var teamList = teamService.QueryTeams(tp.Uri);
foreach(var t in teamList)
{
var userIdentity = t.GetMembers(collection, MembershipQuery.Expanded).Where(ti=>ti.UniqueName.Equals("[user accunt, e.g. domain\\test]",StringComparison.OrdinalIgnoreCase)).FirstOrDefault();
if(userIdentity!=null)
{
user.Teams.Add(t.Name);
user.Alias = userIdentity.UniqueName;
user.DisplayName = userIdentity.DisplayName;
}
}
}
Console.WriteLine(user);
Console.Read();
相关问题
- 1. Google Developers Console - 邀请用户参与项目时出错
- 2. VSTS项目下的回购
- 3. 检查现有项目VSTS
- 4. VSTS - 使用PullRequest添加工作项目
- 5. 使用VSTS构建libgdx项目
- 6. 使用JTextField列出项目
- 7. 列出与多个“嵌套”项目
- 8. 将VSTS 2008与VSTS 2010一起使用
- 9. VSTS 2K8崩溃导致项目锁定(如被检出编辑)
- 10. 解析JSON列出与通用领域的项目与GSON
- 11. Vsts(原Visual Studio Online)复制项目
- 12. VSTS在线建筑安装项目?
- 13. 从项目中删除VSTS链接
- 14. VSTS NuGet pack排除测试项目
- 15. VSTS打包只更改项目
- 16. Xamarin.Forms.ListView项目与参数
- 17. 如何参与项目?
- 18. 无法在Azure中选择我的“部署项目”(VSTS项目)
- 19. 请参阅列表项目
- 20. VSTS拓与Angular2
- 21. 列出来自用户的所有项目的外键
- 22. 用户在Git中列出结账项目
- 23. Serena Dimensions:查找特定用户签出的项目列表
- 24. ZF项目与用户指南
- 25. 与用户和项目在果园CMS
- 26. 如何比较列表中的项目与用户输入?
- 27. 存储与特定项目关联的用户列表
- 28. Excel用户窗体与列表来选择多个项目
- 29. 根据与用户相关的项目获取数据列表
- 30. 从用户输入项目列表
你解决我们的解决方案的问题? –