You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在Azure DevOps(VSTS)中查询关联/未关联测试的工作项?

Hey there! Awesome that you're leveraging Azure DevOps (VSTS) work item queries—they're such a powerful tool for tracking your work. Let's tackle how to pull lists of work items that are linked to tests, and those that aren't, with clear steps and the right fields to use.

1. Query Work Items Linked to Tests

There are a couple of straightforward ways to find work items that have associated test cases, test plans, or test suites:

  • Use the Linked Work Items condition
    In the query editor, add a new clause with these settings:

    • Field: Linked Work Items
    • Operator: Contains
    • Value: Test Case (adjust this to Test Plan or Test Suite if you're targeting those instead)

    This will return any work item that has a direct link to a test case.

  • Add relevant columns to visualize links
    To see exactly which tests are linked, add these built-in columns to your query results:

    • Linked Work Items: Shows all linked work items (including tests) in a single column
    • Test Cases: A dedicated column that only displays associated test cases
    • Test Plan/Test Suite: If your tests are organized under plans/suites, these columns will show that hierarchy too
2. Query Work Items Not Linked to Tests

To find work items that have no associated tests, use one of these approaches:

  • Negate the Linked Work Items condition
    Add a clause like this:

    • Field: Linked Work Items
    • Operator: Does Not Contain
    • Value: Test Case

    If you need to exclude multiple test-related work item types, use the Not In operator and list all relevant types (e.g., Test Case, Test Suite).

  • Check for empty Test Cases field
    The Test Cases field automatically populates when a work item is linked to a test case. So you can use this simple clause:

    • Field: Test Cases
    • Operator: Is Empty

    This is my go-to method because it's specifically targeted at test case associations, avoiding false negatives from other link types.

Quick Pro Tip

Save these queries as shared queries in your project so your whole team can access them easily. You can also nest queries if you want to get fancy—for example, find user stories linked to failed test cases by combining a test case status filter with the link condition.

内容的提问来源于stack exchange,提问作者MajinBoo

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.08 21:22:33