我正在寻找可以从区域路径返回所有工作项及其关系的查询。
例如:项目 1
我需要所有精选的所有用户故事映射到它所有工作项和错误映射到用户故事,
简而言之,如果我从对象中获取了一个错误,我需要类似父 ID 之类的东西,我可以在其中与用户故事匹配。
string query1 = " SELECT * FROM WorkItemLinks " +
" WHERE ( [System.IterationPath] Under 'iteration1' )" +
" AND ([System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward' )" +
" ORDER BY [Microsoft.VSTS.Scheduling.StartDate]";
抛出如下错误
An exception of type 'Microsoft.TeamFoundation.WorkItemTracking.Client.ValidationException' occurred in Microsoft.TeamFoundation.WorkItemTracking.Client.dll but was not handled in user code
Additional information: TF51005: The query references a field that does not exist. The error is caused by «[System.IterationPath]».
当我检查 dll 的引用是否正确并且当我像这样重新编写查询时,查询工作正常
string query = " SELECT * FROM WorkItems"+
" WHERE ( [System.IterationPath] Under 'iteration1' )" +
//" AND ([System.State] = 'Active' OR [System.State] = 'Assessed' ) "+
//" AND ( [Microsoft.VSTS.Scheduling.StartDate] <= '09/13/2017' AND [Microsoft.VSTS.Scheduling.FinishDate] >= '09/13/2017' )"+
" ORDER BY [Microsoft.VSTS.Scheduling.StartDate]";
但是这个查询结果并没有给出这样的关系,即如果一个工作项作为子项映射到另一个我需要工作项对象中的父 id。如何得到。提前致谢。