Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to query RTC work item children for exact match of multiple attributes?

I am using RTC 4.0.2 and have Epics with multiple Stories linked as children. I would like to run a query that lists all Epics with children that match multiple conditions per child:

[AND All must match]:
Type is Epic
Children > attribute_A is abc
Children > attribute_B is xyz

I am getting ambiguous results with the above query, because there might be a child matching the first condition (attribute_A is abc) and another child matching the second condition (attribute_B is xyz) while there is none that matches both conditions.
I would only be interested in listing Epics having at least one child that exactly matches both conditions.

Is there any way to build a query for this?

Any ideas would be appreciated,

Volker

0 votes


Accepted answer

Permanent link
I think Lauren suggests the only possible way of doing it. The issue is, that although queries can follow relationships, the query language does not contain any means to express "For all children (condition on child)" or other complex conditions that would allow what you want, as far as I know. I once tried to create some queries that attempted this and I was never really able to accomplish it. I have seen some questions here in the forums around similar requirements and the same outcome.

I can't comment on BIRT.

It would be possible to use the API to run queries and to use the results returned for additional computation. Some example code can be found here: http://rsjazz.wordpress.com/2012/11/19/using-expressions-for-automation/ http://rsjazz.wordpress.com/2012/10/29/using-work-item-queris-for-automation/ . You could run through result sets, access the resulting work items and do comparisons on the attributes. See http://rsjazz.wordpress.com/2013/01/02/working-with-work-item-attributes/ and http://rsjazz.wordpress.com/2012/09/19/the-rtc-workitem-link-api-linking-workitems-to-other-elements/ as well as other posts on that blog.

I am not sure if you could create a server extension that would do the same and be provided as query though. 
Volker Hoose selected this answer as the correct answer

0 votes


3 other answers

Permanent link
Hi Volker,

A roundabout way to get the results you want is to query for a work item where attribute a is abc, where attribute b is xyz, and who has a parent of type epic.  Then you can edit the results to display the parent work item.  The problem with this is that the same epic might be listed more than once.

You might be able to create a query like this programmatically and then filter out the results so that each parent epic is only listed once.

0 votes


Permanent link
Hi Lauren,

thanks for your quick response. Yes, I understand that using a query on the children (Stories) would lead to a precise evaluation of conditions (all stories that have attribute_A and attribute_B).

Unfortunately, I am interested in listing the parent (Epic) as a result of the query as I also need to display some attributes of the parent in the output (and I suppose there is no way to do this if the query returns Stories).

Regarding a programmatic solution, what would that involve? I have started looking at BIRT for building a report but this seemed rather difficult to accomplish.

0 votes

Comments
Hi Volker, I don't know of a way to display more about the epics using the query I described. This link has more information on how to programmatically query work items: https://jazz.net/wiki/bin/view/Main/QueryDevGuide. I don't have experience with BIRT reports, so I'm not sure how difficult they are.


Permanent link
Ralph, thank you for sharing your experience. I will have a look at the links that you provided.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 41

Question asked: May 23 '13, 5:53 a.m.

Question was seen: 111 times

Last updated: May 23 '13, 9:35 a.m.

Confirmation Cancel Confirm