get all my features + stories from all AND all my stories connected to other features

1k Views Asked by At

This question is about Azure Boards and querying Work Items.

My use case is:

  • I have different projects set up
  • epics and features are maintained in a global planning project
  • stories life in the product projects
  • the final setup will be quite huge that’s why this separation has been introduced we will have to ensure the system is maintainable (permissions etc.)
  • association from the planning project to others works with area paths which are set up in the planning project and represent the structure of all projects
  • some features need support from other projects so I setup one parent-child-linked story in the other project
  • I want now a single hop query which shows me all features and the child stories
  • the rules should be:
    • show all the features I have associated to my project plus all the stories connected to them, this includes stories which are in other projects and teams
    • show also all my stories, including those which I’m doing for other features in other projects

For more visual people an example diagram below. In queries which are saved as shared queries in all 3 projects there should be this result:

  • Project "Product 1" sees both product features and its stories as one is the own feature and the other contains a story which is linked to the own project / team
  • Project "Product 2" has the same vice versa
  • The Project Platform sees also both of these product features as it has a story of each plus it has a third feature which is not in the queries of the products as it only contains Platform stuff

Features Stories cross Project

I want to see that because the dependencies are important and each project team should see, where they have dependencies to other products and where they have to deliver or are waiting for things.

Bildschirmfoto 2021-02-15 um 07 49 13 (example of the query one below "give me all stories belonging to my features")

The only way I found so far is to have two separate queries which apply the two mentioned rules and combine them. A UNION (without duplicates, so no UNION ALL) would do the trick in one go. Here are my current two test queries.

/** give me all stories belonging to my features **/
SELECT
    [System.Id],
    [System.WorkItemType],
    [System.Title],
    [System.AssignedTo],
    [System.State],
    [System.Tags]
FROM workitemLinks
WHERE
    (
        [Source].[System.WorkItemType] = 'Feature'
        AND [Source].[System.AreaPath] UNDER 'PI-Planning\Plattform'
    )
    AND (
        [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward'
    )
    AND (
        [Target].[System.WorkItemType] <> ''
    )
ORDER BY [System.Id]
MODE (MayContain)
/** give me all features belonging to my stories **/

SELECT
    [System.Id],
    [System.WorkItemType],
    [System.Title],
    [System.AssignedTo],
    [System.State],
    [System.Tags]
FROM workitemLinks
WHERE
    (
        [Source].[System.WorkItemType] = 'Feature'
    )
    AND (
        [System.Links.LinkType] = 'System.LinkTypes.Hierarchy-Forward'
    )
    AND (
        [Target].[System.WorkItemType] <> ''
        AND [Target].[System.AreaPath] = 'Plattform'
    )
ORDER BY [System.Id]
MODE (MustContain)

I also opened a feature request at Microsoft but until someone replies there, we get old and grey ...

WIQL: allow UNION of queries

0

There are 0 best solutions below