Reputation: 477
I'm looking for a way to get the work capacity and or days off for teams and users using the c# tfs client libraries. I can't find any docs on this!
But I could've been looking in the wrong places the whole time.
Upvotes: 2
Views: 996
Reputation: 31075
Please refer to the code snippet below:
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;
Upvotes: 3