![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
Topic Title: Using Query to find Tasks with no associated Problems Topic Summary: CS Query Created On: 22-Mar-2007 19:17 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: I often struggle to determine the relationships between various objects. The secret I have found is the relate command. Here is what I do: First, query for an item that you wish to find the relationship to. In your situation you are looking for tasks without associated problems. We have to query for something with this relationship before we can find those that don't, so task #5870 in my repository does have an associated problem and I query for this particular task. ccm query "name='task5870'" Next, run the relate command on the result of the previous query: ccm relate -show -t @1 (BTW @1 will run the ccm relate -show -t on the first row of the result set returned in the previous query) In my particular repository, many items are returned in the result set of the ccm relate command, but the one of interest to me was this: problem1139~1 ![]() It is a problem and the particular relation back to my task. So if I wanted to find tasks which do not have associated problems, my query would be: ccm query "type='task' and not is_associated_task_of(type='problem')" Hoep this helps! Angela | |
![]() |
|
I'm trying to create a query string that will display tasks with no associated cr. There doesn't seem to be an 'associated_problem' relation. I tried this:
cvtype='task' and not has_associated_problem(cvtype='problem') Thanks! ------------------------- Terry Carpenter |
|
![]() |
|
![]() |
|
I often struggle to determine the relationships between various objects. The secret I have found is the relate command. Here is what I do:
First, query for an item that you wish to find the relationship to. In your situation you are looking for tasks without associated problems. We have to query for something with this relationship before we can find those that don't, so task #5870 in my repository does have an associated problem and I query for this particular task. ccm query "name='task5870'" Next, run the relate command on the result of the previous query: ccm relate -show -t @1 (BTW @1 will run the ccm relate -show -t on the first row of the result set returned in the previous query) In my particular repository, many items are returned in the result set of the ccm relate command, but the one of interest to me was this: problem1139~1 ![]() It is a problem and the particular relation back to my task. So if I wanted to find tasks which do not have associated problems, my query would be: ccm query "type='task' and not is_associated_task_of(type='problem')" Hoep this helps! Angela ------------------------- Angela Kim |
|
![]() |
|
![]() |
|
Angela,
Thanks! I'm able to plug the query string into Change-->Query-->Tasks and get the info. Also, I had not used the ccm relate cmd before and it helps. Regards, Terry ------------------------- Terry Carpenter |
|
![]() |
|
![]() |
|
A quicker form of the same query would be: ccm query "type='task' and is_no_associated_task()". Only possible from 6.4 onward where is_no_<relationship> and has_no_<relationship> query clauses were added. Usefull in huge databases.
|
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.