0
我試圖通過使用wiql查詢來獲取團隊項目的所有不同迭代路徑。c#WIQL查詢獲取所有不同的迭代路徑
我實際的解決方案如下:
我用這個查詢
public static readonly string IterationPathsQuery = @"SELECT [System.IterationPath] FROM workitems
WHERE[System.WorkItemType] = 'Requirement'
OR[System.WorkItemType] = 'Feature'";
要獲得所有相關的工作項和遍歷它們把所有的不同迭代路徑。
private void FillIterationPathComboBox(WorkItemStore wiStore)
{
WorkItemCollection wiCollection = wiStore.Query(Constants.IterationPathsQuery);
var paths = new List<string>();
...
foreach (WorkItem wi in wiCollection)
{
...
if (!String.IsNullOrEmpty(wi.IterationPath) && !paths.Contains(wi.IterationPath))
{
paths.Add(wi.IterationPath);
}
}
foreach (string path in paths)
{
IterationPathComboBox.Items.Add(path);
}
}
但是這個解決方案並沒有很好的性能。 有沒有辦法只查詢使用的不同迭代路徑?我已經讀過「不同」並不支持,但也許有一種方法我還沒有考慮。
你想獲得該項目的一些具體工作項目的所有迭代路徑或只是不同的迭代路徑? –