MQL query to create table showing multiple Type.

Follow

Comments

5 comments

  • Avatar
    Jay Mitchell

    Are feature, story and test case part of a card tree?

  • Avatar
    stormfront13

    Yes.. Feature---->Story----->Test Case.


    Test Case is linked to Story.


    Story is linked to Feature.


    No Direct connection from Test Case to Feature.


     


    I tried to write a query which used Type with both Story and Test Case but it just ended up pulling data for both.  What I am trying to actually gets is a table that displays each individual test case, the result of the test case, Story, and Feature.


     


    Thanks!

  • Avatar
    Jay Mitchell

    Because this is part of a tree, the test case will have a link to the story and the feature. The query would be something like, "SELECT number, name, 'test result', 'Tree - Feature', 'Tree - Story' WHERE type='test case'" (The name of your feature and story properties will have a different name - you can find the name by opening a test case card and looking at the tree properties which are at the bottom of the properties for the card.)

  • Avatar
    stormfront13

    As we are set up now,


    Features are set up as Feature- Story Tree


    Storys are linked to the the Feature- Story Tree and Planning Tree


    Test cases are linked only to Planning Tree.


    Can a Test case be linked to both the Planning Tree and Feature- Story Tree?

  • Avatar
    Jay Mitchell

    It is possible to link cards across trees using the beta nested IN clause. Suppose you are on a specific test case card, you could have the following table query to show the test case's feature, story and test case:


    {{
      table
        query: SELECT type, number, name WHERE (type='test case' AND number = this card.number) OR (type=story AND number = this card.'planning - story') OR (type='feature' AND name IN (SELECT 'feature - story - feature' WHERE type=story AND number = this card.'planning - story')) ORDER BY type
    }}

    The limitation to this is that you can only show a single test case/story/feature group of cards. I.e., if you had a bunch of features, they would all be grouped together at the top of the table. (I'm assuming the ordering of the card types is feature>story>test case - this can be set up on the card types admin page.)


    As you can see, that query is fairly complicated because it is a bit generic, the general, non-generic form is:


    {{
      table
        query: SELECT type, number, name WHERE (type='test case' AND [test case conditions]) OR (type=story AND [story conditions]) OR (type='feature' AND [feature conditions]) ORDER BY type
    }}

    Where [test case conditions], [story conditions] and [feature conditions] can be whatever you decide they should be. Using this form, even with the limitions I mentioned above, you could show all of the test cases associated with a story, the story and the feature associated with the story.

Please sign in to leave a comment.