How to use relationship properties in where clauses of queries?#611

Subscribe to How to use relationship properties in where clauses of queries? 6 post(s), 4 voice(s)

 
Avatar Koen De Hondt 56 post(s) #1548

I have a problem and I cannot find the solution in http://studios.thoughtworks.com/mingle/2.0/help/mql_reference.html. I also looked in http://studios.thoughtworks.com/mingle/2.0/help/macro_reference.html under “Markup value query”, but the text says: “Source file topics/markup_value_query.xml missing.”

I have feature cards and epic cards. I have a tree Epic > Feature. The tree is called “Scope” and the relationship property is called “Scope – Epic”. I like to express queries about features in the context of their epic. For instance, if I like to count the feature cards associated with an epic card with number 796, I would expect to write it like this:

{{value query: select count(*) where type = feature and 'Scope - Epic' = 796}}

But that does not work. How do I refer to a card as a value for “Scope – Epic”?

 
Avatar Suzie Prince Administrator 189 post(s) #1554

Koen

In 2.0 you need to refer to cards as relationship property values by their name (not number) so the query below should do it for you:

 {{value query: select count(*) where type = feature and 'Scope - Epic' = '[card name]' }} 

I have made a note to update the help text for this area.

Also we have a candidate story to enhance this functionality so it works with a reference to a card number as well as a name.

Thanks Suzie

 
Avatar Koen De Hondt 56 post(s) #1559

Thanks Suzie.

Referring to the number instead of the name makes sense, because the name may change while the number does not change. I would not like having to change all the queries that use the name when the name changes.

 
Avatar Jake 27 post(s) #1696

Doesn’t look like the help text was updated and that would have saved me some time.

 
Avatar Badri Janaki... Administrator 25 post(s) #1698

Jake – the online help does contain this information. For future quick reference , please see this page -> http://studios.thoughtworks.com/mingle/2.0.1/help/mql_reference.html

 
Avatar Jake 27 post(s) #1723

sure enough. I was using the 2.0 link (http://studios.thoughtworks.com/mingle/2.0/help/mql_reference.html) and I swear it was showing the card number. interesting.

BTW it wasn’t clear that ‘[card name]’ does not include the brackets. A better example would be: ‘Iteration’ = ‘Iteration 1’