edtro / EdTro.AzureDevOps.Extensions.querybasedboards

Query Based Boards enables a user to visualize the result of work item queries as a board and track the dependencies.
MIT License
23 stars 2 forks source link

question: get all my features + stories from all AND all my stories connected to other features #40

Closed JamborJan closed 3 years ago

JamborJan commented 3 years ago

There is one thing, I stumbled over while setting up things with qbb. I know it's not directly related to qbb, it0s rather a thing how queries work in Azure DevOps. But maybe you know a better way round this thats why I dre to post this question here too.

My use case is:

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:

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)

As I know that this doesn't belong to qbb natively, I also opened a feature request at Microsoft but until someone replies there, we get old and grey ...

WIQL: allow UNION of queries

Update: I also posted a stackoverflow question, maybe I get some infos there: https://stackoverflow.com/questions/66203920/get-all-my-features-stories-from-all-and-all-my-stories-connected-to-other-fea

I hope this is useful also for others using Azure DevOps and Query Based Boards.

edtro commented 3 years ago

Dear @JamborJan

The two queries are actually really alike... and I understand that your want to add condititions just on the Feature level, so I think that you should be a little bit creative using the 'OR' clauses (and nesting them). I am not aware of if the UNION clause is available or will be. But in my experience, you generally use this clause when you are querying multiple tables and you want to output the results as one resultset.

I think I would have really have to deep dive into this issue, to be able to help you with this. But I really do not have the time to do this. My appologies... (my employer is running a consultancy company and we has got a number of consultants that are specialised in using tools like Azure DevOps, so maybe this could be an option)

This extension is just about displaying the query results as-is... so I am closing this issue.

Kr Edward

edtro commented 3 years ago

Btw: you can take a look at an extension, that is specialized in building WIQL queries, see: https://marketplace.visualstudio.com/items?itemName=ottostreifel.wiql-editor