0

I call IBuildServer.QueryBuilds(), and look at the returned IBuildDetails:

  • TFS2010: They are populated with user aliases.
  • TFS2012: They are null.

How can I get the user names in TFS2012?

var collection = new TfsTeamProjectCollection(new Uri(_txtCollection.Text));
var buildServer = collection.GetService<IBuildServer>();

var spec = buildServer.CreateBuildDetailSpec(Settings.Default.ProjectName);
spec.QueryOptions = QueryOptions.Definitions;
spec.QueryOrder = BuildQueryOrder.StartTimeDescending;
spec.InformationTypes = null;

return buildServer.QueryBuilds(spec).Builds;
rene
  • 41,474
  • 78
  • 114
  • 152
Jonathan
  • 6,939
  • 4
  • 44
  • 61

1 Answers1

0

Add batchedrequests:

spec.QueryOptions = QueryOptions.Definitions
                  | QueryOptions.BatchedRequests;  // Tell TFS2012 to populate RequestedFor / RequestedBy
Jonathan
  • 6,939
  • 4
  • 44
  • 61