如何使用tfs api获取与变更集ID相关联的工作项?

问题描述:

我需要以编程方式获取与选定变更集相关联的工作项列表.到目前为止,我已经能够使用Artifacts的概念来获取与工作项ID相关的变更集,并能够通过以下方式获得与特定构建相关的变更集和/或工作项:

Hi I need to get a list of work items that are associated with selected changesets programmatically. So far I have been able to get the changesets associated with a work item ID using the concept of Artifacts, as well as got the changesets and/or workitems associated with a particular build using :

InformationNodeConverters.GetAssociatedChangesets()和InformationNodeConverters.GetAssociatedWorkItems().

InformationNodeConverters.GetAssociatedChangesets() and InformationNodeConverters.GetAssociatedWorkItems() respectively.

我正在使用VSTS 2010 beta1.有人知道该解决方案吗?

I am using VSTS 2010 beta 1. Anyone know the solution?

尝试一下:

Changeset cs = versionControlServer.GetChangeset(changesetId);

foreach (WorkItem wi in cs.WorkItems)
{
    Console.WriteLine(wi.ID);
}