It's all about the answers!

Ask a question

Work Item Querying


Sunita Dinakar (11413842) | asked Sep 14 '10, 4:24 a.m.
Hi,

In RTC 2.0.0.2 , while querying for a work item type say Defects whose child should satisfy the below conditions.


---------Cond1-------Cond2--------Cond3
Child1--Satisfies----Satisfies------Satisfies

but, RTC displays Defects even in the below scenario,

---------Cond1-------Cond2--------Cond3
Child1--Satisfies
Child2---------------Satisfies-------Satisfies
Child3--------------------------------Satisfies

RTC applies the "AND" conditions with the combination of more than one child instead of grouping within the same child.
We have used all possible AND grouping but still doesn't work. Can the experts share their thoughts?

Cheers,
Sunita

6 answers



permanent link
David Castellanos (20686) | answered Sep 14 '10, 3:29 p.m.
Hi,

In RTC 2.0.0.2 , while querying for a work item type say Defects whose child should satisfy the below conditions.


---------Cond1-------Cond2--------Cond3
Child1--Satisfies----Satisfies------Satisfies

but, RTC displays Defects even in the below scenario,

---------Cond1-------Cond2--------Cond3
Child1--Satisfies
Child2---------------Satisfies-------Satisfies
Child3--------------------------------Satisfies

RTC applies the "AND" conditions with the combination of more than one child instead of grouping within the same child.
We have used all possible AND grouping but still doesn't work. Can the experts share their thoughts?

Cheers,
Sunita


Hi Sunita,

I haven't been able to reproduce this so I would like to make sure I am understanding your question.
You would like to query children work items that have a parent of type 'Defect'. The result should then be queried for three different conditions. Your issue is that children work items show as a result when either of the three conditions is met, instead of when all conditions are met. Is this right? If not, let me know where I went wrong.

Here is what I did to get what *I think* is what you want:
Start a query from scratch, have the first condition be 'Parent -> Type (Defect)'. This will show us all work items that have a parent of type Defect. From here on, you just have to add more conditions such as priority and severity...
It is just saying: Show me all the work items that have a parent of type 'Defect' and have priority 'x' and Severity 'y'.

This should work.

permanent link
Sunita Dinakar (11413842) | answered Sep 15 '10, 1:00 a.m.
Hi,

In RTC 2.0.0.2 , while querying for a work item type say Defects whose child should satisfy the below conditions.


---------Cond1-------Cond2--------Cond3
Child1--Satisfies----Satisfies------Satisfies

but, RTC displays Defects even in the below scenario,

---------Cond1-------Cond2--------Cond3
Child1--Satisfies
Child2---------------Satisfies-------Satisfies
Child3--------------------------------Satisfies

RTC applies the "AND" conditions with the combination of more than one child instead of grouping within the same child.
We have used all possible AND grouping but still doesn't work. Can the experts share their thoughts?

Cheers,
Sunita


Hi Sunita,

I haven't been able to reproduce this so I would like to make sure I am understanding your question.
You would like to query children work items that have a parent of type 'Defect'. The result should then be queried for three different conditions. Your issue is that children work items show as a result when either of the three conditions is met, instead of when all conditions are met. Is this right? If not, let me know where I went wrong.

Here is what I did to get what *I think* is what you want:
Start a query from scratch, have the first condition be 'Parent -> Type (Defect)'. This will show us all work items that have a parent of type Defect. From here on, you just have to add more conditions such as priority and severity...
It is just saying: Show me all the work items that have a parent of type 'Defect' and have priority 'x' and Severity 'y'.

This should work.


Hi David,

Thanks for your response. Your understanding is almost perfect. But here is my exact situation. (Here i want only the Parent id, that is Defects. When i say parent type is defect, it will list only the child).

I have started a query from scratch and here goes my conditions :

Type is Defect
Children TaskType is Code
Children Found in Release1

The above query lists Defects even if one of its child satisfies Code and the next Child satisfies Release1.

The only difference between your query and mine, i guess should be is, your query would list the Child and mine would list the Parent (this is where the issue is.)

Please let me know if my post is not clear, I can explain it better if needed.

Cheers,
Sunita

permanent link
David Castellanos (20686) | answered Sep 15 '10, 3:14 a.m.

Hi David,

Thanks for your response. Your understanding is almost perfect. But here is my exact situation. (Here i want only the Parent id, that is Defects. When i say parent type is defect, it will list only the child).

I have started a query from scratch and here goes my conditions :

Type is Defect
Children TaskType is Code
Children Found in Release1

The above query lists Defects even if one of its child satisfies Code and the next Child satisfies Release1.

The only difference between your query and mine, i guess should be is, your query would list the Child and mine would list the Parent (this is where the issue is.)

Please let me know if my post is not clear, I can explain it better if needed.

Cheers,
Sunita


Ok, you want all parent work items that have at least one child satisfying 'n' conditions.
Unfortunately I have been unable to get something like that working.
The closest thing I got was querying work items that have a parent of type Defect and that satisfy the conditions. The result is a child work item, which is not exactly what you want. You can however show specific relationships in the Work Items view (in the RTC client) by clicking on the menu area and selecting 'Parent' in 'Relationships...'.

Perhaps someone that knows more about querying can better help you...

permanent link
Sunita Dinakar (11413842) | answered Sep 15 '10, 3:18 a.m.

Hi David,

Thanks for your response. Your understanding is almost perfect. But here is my exact situation. (Here i want only the Parent id, that is Defects. When i say parent type is defect, it will list only the child).

I have started a query from scratch and here goes my conditions :

Type is Defect
Children TaskType is Code
Children Found in Release1

The above query lists Defects even if one of its child satisfies Code and the next Child satisfies Release1.

The only difference between your query and mine, i guess should be is, your query would list the Child and mine would list the Parent (this is where the issue is.)

Please let me know if my post is not clear, I can explain it better if needed.

Cheers,
Sunita


Ok, you want all parent work items that have at least one child satisfying 'n' conditions.
Unfortunately I have been unable to get something like that working.
The closest thing I got was querying work items that have a parent of type Defect and that satisfy the conditions. The result is a child work item, which is not exactly what you want. You can however show specific relationships in the Work Items view (in the RTC client) by clicking on the menu area and selecting 'Parent' in 'Relationships...'.

Perhaps someone that knows more about querying can better help you...

Selecting Parent in Relationships cannot be exported to an excel :(
However, thanks for your time and suggestion.

Cheers,
Sunita

permanent link
jean-claude vauthier (22634957) | answered Oct 05 '10, 11:30 a.m.
Using the work item query editor.

Type is : story
+
Full text : "MyStory"

=> result OK, the Work Items view display the story "Mystory"

--------------------------

Type is : Task
+
Parent > Type is : Story
+
Parent > Full Text contains : "MyStory"

=> Nothing. I was expecting to display all the tasks which parent name is "Mystory"

I have probably misunderstood something

permanent link
Sunita Dinakar (11413842) | answered Oct 06 '10, 12:45 a.m.
Hi Jean,

Thanks for the post.

I am trying to query for the parent here. This is where i have a problem.

Cheers,
Sunita

Using the work item query editor.

Type is : story
+
Full text : "MyStory"

=> result OK, the Work Items view display the story "Mystory"

--------------------------

Type is : Task
+
Parent > Type is : Story
+
Parent > Full Text contains : "MyStory"

=> Nothing. I was expecting to display all the tasks which parent name is "Mystory"

I have probably misunderstood something

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.