我正在寻找一种方法来获得使用c#tfs客户端库的团队和用户的工作能力和休息时间。我找不到任何关于此的文档!
但我可能一直在找错地方。
答案 0 :(得分:1)
请参阅下面的代码段:
String collectionUri = "http://TFS2017:8080/tfs/defaultcollection";
VssCredentials creds = new VssClientCredentials();
creds.Storage = new VssClientCredentialStorage();
VssConnection connection = new VssConnection(new Uri(collectionUri), creds);
var whc = connection.GetClient<WorkHttpClient>();
var capacity = whc.GetCapacitiesAsync(new Microsoft.TeamFoundation.Core.WebApi.Types.TeamContext("Teamproject"), new Guid("Iterationid")).Result;
var daysoff = whc.GetTeamDaysOffAsync(new Microsoft.TeamFoundation.Core.WebApi.Types.TeamContext("Teamproject"), new Guid("Iterationid")).Result;