It's all about the answers!

Ask a question

Query for "Leaf" Stories


Chris Barlock (18814738) | asked May 03 '12, 12:09 p.m.
I'm trying to build a query to find all "leaf" stories in a sprint -- those stories that have no child stories. I started with:

Planned For > Name contains <Sprint> AND Type is Story AND Status is Unresolved

I want to add:

AND (Children do not exist OR Child > Type is not Story)

First, does this sound like the right logic? Second, I'm not sure how to build this parenthetical OR block using the query editor. Thoughts?

Thanks,

Chris

3 answers



permanent link
Geoffrey Clemm (30.1k33035) | answered May 03 '12, 2:02 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Adding a block is easy. In the Eclipse query editor, click on the triangle, and select the choice that says "add AND/OR group".

Adding a children constraint is also easy ... in the Eclipse query editor, when you click on the + sign icon, it will show the Add_Contributor wizard, and select the "Show Relations" radio button.

But unfortunately, the Relations condition is a "there exists" condition, not a "for all" condition. so what you will get is "there exists a child whose state is not story" ... which isn't what you want.

So I don't think you can use the query editor to build this query.

Cheers,
Geoff

I'm trying to build a query to find all "leaf" stories in a sprint -- those stories that have no child stories. I started with:

Planned For > Name contains <Sprint> AND Type is Story AND Status is Unresolved

I want to add:

AND (Children do not exist OR Child > Type is not Story)

First, does this sound like the right logic? Second, I'm not sure how to build this parenthetical OR block using the query editor. Thoughts?

Thanks,

Chris

permanent link
Chris Barlock (18814738) | answered May 03 '12, 2:26 p.m.
I must be missing something, Geoff. I don't see these things you mention (we are on RTC 3.0.1.3). If I click +, I get the Add Conditions dialog, not a wizard. If I click the down pointing triangle, I can select Add Conditions, or any of several groups. I don't see Show Relations.

The query editor does have the conditions I want:

Children do not exist
Child > Type is not Story

Hmmm...Maybe I can break up the logic. If I add a second AND group, what is the relationship between the two? Is it Group A OR Group B? If so, I could do:

Planned For > Name contains <Sprint> AND Type is Story AND Status is Unresolved AND Children do not exist

OR

Planned For > Name contains <Sprint> AND Type is Story AND Status is Unresolved AND Child > Type is not Story

Chris

permanent link
Chris Barlock (18814738) | answered May 03 '12, 3:00 p.m.
I think I got it. I noticed a nesting relationship in the query editor, so I created an outer OR group with two inner AND groups to create the logic I listed in my previous posts.

Chris

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.