开发者

Retrive a list of opened Work Items for a given project in TFS 2010 programmatically

I am trying to retrieve a list of opened work items for a given project programmatically. In searching through the web, the only way that I can see to do this is to use the WorkItemStore API and execute a query.

The major issue that I am having is that retrieving the workitemstore takes almost 2 minutes. I subsequently caches it, but the first hit is unacceptable. Beyond that, my application needs to refresh it every x number of minutes in case new work items are added.

Is there any way to get a list of opened work items associated with a project without using the WorkItemStore. I only need the work item number and optionally the title. I don't need any other information.

If not, is there something that I am doing wrong or something wrong with the TFS server (index missing perhaps) that makes the performance so slow. I have tried different ways of getting it by the way. They are all extremely slow.

WorkItemStore store = (WorkItemStore)tfs.Get开发者_运维技巧Service(typeof(WorkItemStore));

or

workItemStore = new WorkItemStore(tfsTeamProjectCollection);

or

workItemStore = new WorkItemStore(tfsServerName);

Any help in this matter would be greatly appreciated.


Even with an incredibly large DB you shouldn't experience two minutes delays.

I would load up SQL Profiler and take a look at the query generated to get work items. From there, you can probably identify what part of the query is causing the delay.

You can also consider running the query on the same box that the TFS DBs are on and see if that is the issue. As the comment above points out, remote connections can certainly cause delays.

If none of this resolves the issue then hopefully you can provide some more information like size of the project (shouldn't matter), TFS installation configuration (where are your servers and how are they setup) and what hardware it is on.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜