1

Similar to this question : How can I retrieve a list of workitems from TFS in C#?

But I am trying to retrieve the queries (not workitems) of the user (to call them later, but that's another topic). Is it possible to do that with C# ?

Also, related, is there any documentation anywhere about the tables that are used in the WorkItemStore.Query object ?

Sorry if this has been asked before, but googling with TFS and queries returns a lot of unwanted results (obviously).

Thanks !

Community
  • 1
  • 1
vpi
  • 191
  • 1
  • 14

1 Answers1

2

Aaaaaaaaaaaand, looking 5 minutes into the namespace would have saved me from writing yet another useless SO question. Answer if anyone is ever interested :

TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri("Uri"));
tfs.EnsureAuthenticated();

WorkItemStore workitemstore = tfs.GetService<WorkItemStore>();
QueryHierarchyProvider queryProvider = new QueryHierarchyProvider(workitemstore);
Project project = workitemstore.Projects["MyProject"];
var queries = queryProvider.GetQueryHierarchy(project);
jessehouwing
  • 106,458
  • 22
  • 256
  • 341
vpi
  • 191
  • 1
  • 14