如何在 PBI 的迭代中 return 没有 children 的 PBI
How to return PBIs with no children in PBI's iteration
我想通过 TFS 2015 查询编辑器创建一个查询,returns 所有没有任何 children 与 PBI 本身处于同一迭代中的 PBI。
我做到了这一点,但我很难将 children 与 parent 的迭代进行比较:
显然变量@ParentIteration
不存在...还有其他方法可以实现吗?
没有实现此目的的默认方法。您需要使用 TFS api 来实现它。
.net 使用 TFS 查找链接工作项的代码片段 API:
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri("URL"));
WorkItemStore workitemstores = tfs.GetService<WorkItemStore>();
WorkItem workitem = workitemstores.GetWorkItem(ID);
if(workitem.Links.Count!=0)
{
foreach (Link link in workitem.Links)
{
RelatedLink relatedLink = link as RelatedLink;
if (relatedLink != null)
{
Console.WriteLine(relatedLink.RelatedWorkItemId);
}
}
}
REST API 获取工作项列表:
GET https://{instance}/DefaultCollection/_apis/wit/workitems?api-version={version}[&ids={string}&fields={string}&asOf={DateTime}&$expand={enum{relations}]
我想通过 TFS 2015 查询编辑器创建一个查询,returns 所有没有任何 children 与 PBI 本身处于同一迭代中的 PBI。
我做到了这一点,但我很难将 children 与 parent 的迭代进行比较:
显然变量@ParentIteration
不存在...还有其他方法可以实现吗?
没有实现此目的的默认方法。您需要使用 TFS api 来实现它。
.net 使用 TFS 查找链接工作项的代码片段 API:
TfsTeamProjectCollection tfs = new TfsTeamProjectCollection(new Uri("URL"));
WorkItemStore workitemstores = tfs.GetService<WorkItemStore>();
WorkItem workitem = workitemstores.GetWorkItem(ID);
if(workitem.Links.Count!=0)
{
foreach (Link link in workitem.Links)
{
RelatedLink relatedLink = link as RelatedLink;
if (relatedLink != null)
{
Console.WriteLine(relatedLink.RelatedWorkItemId);
}
}
}
REST API 获取工作项列表:
GET https://{instance}/DefaultCollection/_apis/wit/workitems?api-version={version}[&ids={string}&fields={string}&asOf={DateTime}&$expand={enum{relations}]