Custom TFS queries via the API
I have a working utility that queries the TFS workitem store via the TFS API. I can retrieve various开发者_JS百科 pieces of data in this way including listing the Stored query names. However, I can't find the location of Custom Queries. Can anybody point me in the right direction?
Thanks
You mentioned you can't find custom query, in which folder? Team Query or My Query, anyway if you mean my Query, you will need to write code like the following:
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://TFS2011:8080/TFS/DefaultCollection"));
var workItemStore = tfs.GetService<WorkItemStore>();
var queryHirerarchy = workItemStore.Projects[5].QueryHierarchy;
foreach (QueryFolder query in queryHirerarchy)
{
Console.WriteLine(query.Name);
}
But remember My team Queries will be per login credential
Thanks
M.Radwan
I think the info you 're after resides in the TFS-DB named after your Team Project Collection (Tfs_YourCollectionName), under table dbo.QueryItems
I wouldn't know of an API method to obtain the info contained in the columns, directly selecting with SQL on the table should work anyhow (given that you have access).
精彩评论