MQL: How to select parent cards based on child properties?

Follow

Comments

4 comments

  • Avatar
    Nathan Davis

    Alternatively, is there any way to express this with a pivot table?

  • Avatar
    Nathan Davis

    Looks like I probably want WHERE clauses for tree aggregates - which is a candidate feature: http://community.thoughtworks.com/posts/94d837949b

  • Avatar
    Michael Decleene

    A hacky way to do this today would be:


    * Set a numeric property up on your defect cards called (e.g. "IsOpen"), with the expectation that 1 means open and 0 means closed.


    * Set up your card transitions on defects to ensure IsOpen is always set correctly (i.e. starts at 1, flips to 0 when closed)


    * Set up an aggregate property on cards of type story (e.g. "OpenDefects") that is the SUM of IsOpen.


    You should now be able to select cards where state = Failed and OpenDefects = 0, which should select both sets of cards you're interested in.  MQL can handle aggregate properties fine. 


    Edit: I'm not 100% certain if the sum of "no defects" would come across as zero or null, but MQL understands OR so that shouldn't be a huge issue...

  • Avatar
    Matt Quagliana

    Mike's suggestion works very well... create a hidden property that moves from 0 to 1 via a transition.


    BTW... I often use this to calculate velocity via an aggregate. I have a "Story State" property that is initially set to 0 and is set to 1 (via a transition) when the story is completed. Then I create a formula called "Completed Points" which is Points * 'Story State'. An aggregate called Velocity sums up all of the Completed Points in an Iteration.

Please sign in to leave a comment.