Ответ 1
Конечно, вы можете использовать TFS API, чтобы сделать это очень легко.
public static void GetAllChangesetsWithNoWorkItems()
{
var tfs = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(new Uri("http://tfs2010/tfs/default"));
var service = tfs.GetService<VersionControlServer>();
var histories = service.GetBranchHistory(new ItemSpec[] { new ItemSpec(@"$/ProjectName/MAIN/BUILD", RecursionType.OneLevel) }, VersionSpec.Latest);
foreach (BranchHistoryTreeItem history in histories[0])
{
var change = service.GetChangeset(history.Relative.BranchToItem.ChangesetId, true, true);
if(change.WorkItems.ToList().Count == 0)
{
Debug.Write(String.Format("Work Item Missing for Changeset {0}", change.ChangesetId));
}
}
}
Вы можете прочитать это сообщение в блоге о том, как программно подключиться к API TFS http://geekswithblogs.net/TarunArora/archive/2011/06/18/tfs-2010-sdk-connecting-to-tfs-2010-programmaticallyndashpart-1.aspx