It's all about the answers!

Ask a question

How to query same property on workitems and on linked workitems within a query expression?


Guido Schneider (3.4k1379103) | asked Jan 10 '13, 8:10 a.m.
edited Jan 10 '13, 10:54 a.m.
We are using parent/child relationships to break down your work from plan items (e.g. Theme) down to Epics and Stories.

I now like to have a query where I find all children which are not planned for same Iteration than it's parent. I try to setup the following query:

Type = Epic  AND  PlannedFor=MP2  AND  Children.Type=Theme   AND Children.PlannedFor=MP1.1

BUT: what happens is, as soon as I select Childern.PlannedFor the selected field in the expression of the parent is also changing to Children.PlannedFor automatically so I get following nonsens:

Type = Epic  AND  Children.PlannedFor=MP2  AND  Children.Type=Theme   AND Children.PlannedFor=MP1.1

Is this a defect?

Comments
Ralph Schoon commented Jan 10 '13, 10:46 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Hi Guido,

today, the query designer of RTC (and most other products I know of) don't support creating queries that are that kind of nested, trying to evaluate for (work item condition ) And (for all children(nested condition)) or (work item condition ) And (if exist all children(nested condition)). There are a couple of work items that request that kind of capability though.


Guido Schneider commented Jan 10 '13, 10:58 a.m.

CQ is able to do.

The silly thing is, you can add the children property in the expression editor, get the select box for the iteration but as soon as you click in the this box it change the setting in the header of the box of the parent.


Ralph Schoon commented Jan 10 '13, 11:03 a.m. | edited Jan 10 '13, 11:03 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I have been told you would have to use SQL in CQ to do that kind of stuff, but I don't claim to be an expert. I tried some of the obvious queries that fall into these categories and I have found, I think I remember, that RTC can follow the link and always returns the parent if one qualified child exists.


Ralph Schoon commented Jan 10 '13, 11:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Here is an interesting article: https://jazz.net/library/article/1007



Christian Imfeld commented Jan 11 '13, 7:41 a.m.

It seems the problem raises only after I save the query. As long as I'm in unsaved mode the query works

Query Builder


Christian Imfeld commented Jan 12 '13, 10:07 a.m.

Hello

Here are my final investigations ...

(A) The query works within the query builder, incl. one-level relationships (to Parent or Child). I didn't try two or more levels (even not sure if this is possible). The query works (within the query builder) as long you never save the query. Also the displayed content within the query builder is correct, e.g. the box with the parent-relationship shows "Parent->Type".

(B) The query still works if you save the query once within the query builder; even if the displayed content isn't correct anymore. The box with the parent-relationship doesn't show anymore the relation, e.g. "Parent->Type" wll display only "Type". BUT the query is working as expected and can be used within dashboards etc.

(C) As soon as you hit the save button again, the query doesn't work anymore as expected. It still shows the same wrong content in the query builder as described in section (B), but now the query doesn't work anymore as expected.


Christian Imfeld commented Jan 12 '13, 10:08 a.m.

Workaround: If you want to modify/change a query, execute your changes, press the save button; setup the correct query again (by selecting the relationships, etc.) and press the save button once again (and only once :-)


Ralph Schoon commented Jan 12 '13, 10:52 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I would suggest to create a PMR or defect then. It does not seem to make sense a query works in the query builder and not if you save it.

showing 5 of 8 show 3 more comments

Be the first one to answer this question!


Register or to post your answer.