tfswiql

Subrequest in WIQL


How can I use subrequest in WIQL TFS? I need something like this

SELECT
    [System.Id]
FROM workitems
WHERE [System.Id] IN (
    SELECT
        [System.Id]
    FROM workitems
    WHERE [System.Title] == 'Example' 
)

Solution

  • Sorry, this is not available at present. There has already been a related user voice here:

    TFS: Queries based on results of other queries

    https://visualstudio.uservoice.com/forums/330519-azure-devops-formerly-visual-studio-team-services/suggestions/2300378-tfs-queries-based-on-results-of-other-queries

    As a workaround to execute sub queries or joins using the TFS query execution engine you will have to use the method RunLinkQuery().

    For a detail sample you could take a look at this blog: Using the TFS API to display results of a Hierarchical Work Item Query