Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic SYNERGY (steve huntington)
Decrease font size
Increase font size
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
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
Answer This question was answered by Angela Kim, on Friday, March 23, 2007 4:52 PM

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~1roblem:eASAPGov associated_task task5870~1:task:eASAPGov Tuesday, February 28, 2006 3:12:20 PM

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
 22-Mar-2007 19:17
User is offline View Users Profile Print this message


Terrence Carpenter

Posts: 25
Joined: 10-Jul-2003

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
Report this to a Moderator Report this to a Moderator
 23-Mar-2007 10:51
User is offline View Users Profile Print this message


Angela Kim

Posts: 29
Joined: 23-Oct-2003

Answer 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~1roblem:eASAPGov associated_task task5870~1:task:eASAPGov Tuesday, February 28, 2006 3:12:20 PM

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
Report this to a Moderator Report this to a Moderator
 23-Mar-2007 16:52
User is offline View Users Profile Print this message


Terrence Carpenter

Posts: 25
Joined: 10-Jul-2003

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
Report this to a Moderator Report this to a Moderator
 2-May-2007 14:46
User is offline View Users Profile Print this message


Maeve O'Reilly

Posts: 14
Joined: 28-Apr-2005

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.
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic SYNERGY forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 15:34.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.