查询已解决的重复工作项到另一个本身已解决的工作项
Query for workitems which are resolved duplicate to another workitem which itself is resolved fixed
我想查询所有工作项:
- 已解决为重复
- 由特定用户创建
- 在特定日期内解决
- 指向另一个已解决的工作项
这是我试过的:
string itemsMarkedDuplicateParentFixed = "Select [Target].[ID] From WorkItemLinks Where " +
"[Source].[System.WorkItemType] = 'Bug' And " +
"[Target].[System.WorkItemType] = 'Bug' And " +
"[Source].[System.State]='Resolved' And " +
"[Source].[Microsoft.VSTS.Common.ResolvedReason]='Duplicate' And " +
"[Target].[System.State]='Resolved' And " +
"[Target].[Microsoft.VSTS.Common.ResolvedReason]='Fixed' And " +
"[Source].[System.CreatedBy] = 'TomSelleck' And " +
$"[Target].[Microsoft.VSTS.Common.ResolvedDate]>='{resolvedDateFrom}' And" +
$"[Target].[Microsoft.VSTS.Common.ResolvedDate]<='{resolvedDateTo}'";
IEnumerable <WorkItem> appCompatBugsMarkedFixed = await vsoService.GetWorkItems(new Wiql() {
Query = appCompatBugsMarkedDuplicateParentFixed
});
...
public async Task<IEnumerable<WorkItem>> GetWorkItems(Wiql wiqlQuery)
{
using (var workClient = await GetClient())
{
var queryResults = await workClient.QueryByWiqlAsync(wiqlQuery);
return await workClient.GetWorkItemsAsync(queryResults.WorkItemRelations.Select(x => x.Target.Id), expand: WorkItemExpand.All);
}
}
我遇到了这个错误:
Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: 'Not Found'
我正在努力寻找任何 C# 示例来实现我想要的。
您是否尝试通过 Web 或 Visual Studio 设计器进行查询?您可以创建一个查询,对其进行测试,然后将其导出到 VS () or Wiql Editor。与您的查询类似的示例:
在设计器中查询:
查询wiql:
我想查询所有工作项:
- 已解决为重复
- 由特定用户创建
- 在特定日期内解决
- 指向另一个已解决的工作项
这是我试过的:
string itemsMarkedDuplicateParentFixed = "Select [Target].[ID] From WorkItemLinks Where " +
"[Source].[System.WorkItemType] = 'Bug' And " +
"[Target].[System.WorkItemType] = 'Bug' And " +
"[Source].[System.State]='Resolved' And " +
"[Source].[Microsoft.VSTS.Common.ResolvedReason]='Duplicate' And " +
"[Target].[System.State]='Resolved' And " +
"[Target].[Microsoft.VSTS.Common.ResolvedReason]='Fixed' And " +
"[Source].[System.CreatedBy] = 'TomSelleck' And " +
$"[Target].[Microsoft.VSTS.Common.ResolvedDate]>='{resolvedDateFrom}' And" +
$"[Target].[Microsoft.VSTS.Common.ResolvedDate]<='{resolvedDateTo}'";
IEnumerable <WorkItem> appCompatBugsMarkedFixed = await vsoService.GetWorkItems(new Wiql() {
Query = appCompatBugsMarkedDuplicateParentFixed
});
...
public async Task<IEnumerable<WorkItem>> GetWorkItems(Wiql wiqlQuery)
{
using (var workClient = await GetClient())
{
var queryResults = await workClient.QueryByWiqlAsync(wiqlQuery);
return await workClient.GetWorkItemsAsync(queryResults.WorkItemRelations.Select(x => x.Target.Id), expand: WorkItemExpand.All);
}
}
我遇到了这个错误:
Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: 'Not Found'
我正在努力寻找任何 C# 示例来实现我想要的。
您是否尝试通过 Web 或 Visual Studio 设计器进行查询?您可以创建一个查询,对其进行测试,然后将其导出到 VS (
在设计器中查询:
查询wiql: