J'essaie d'obtenir tous les différents chemins d'itération de notre projet d'équipe en utilisant une requête wiql.C# Requête WIQL pour obtenir tous les chemins d'itération différents
Ma solution actuelle est la suivante:
J'utilise cette requête
public static readonly string IterationPathsQuery = @"SELECT [System.IterationPath] FROM workitems
WHERE[System.WorkItemType] = 'Requirement'
OR[System.WorkItemType] = 'Feature'";
Pour obtenir tous les WorkItems pertinents et itérer eux pour obtenir tous les différents chemins itératifs.
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);
}
}
Mais cette solution n'est pas avec de bonnes performances. Existe-t-il un moyen d'interroger uniquement les différents chemins d'itération utilisés? J'ai déjà lu que "distinct" n'est pas supporté, mais il y a peut-être un moyen auquel je n'ai pas encore pensé. WIQL Query ne peut pas filtrer différents chemins d'itération.
Voulez-vous obtenir tous les chemins d'itération du projet ou seulement les différents chemins d'itération pour certains éléments de travail spécifiques? –