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: What perl API function to query CRs via querystring to bring back list of CR IDs?
Topic Summary: What API function to use to query CRs via querystring to bring back list of CR IDs?
Created On: 10-Nov-2006 15:05
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.
 10-Nov-2006 15:05
User is offline View Users Profile Print this message


Coman Wakefield

Posts: 18
Joined: 1-Jun-2005

What perl API function would I use if I wanted to execute a query to bring back a list of Change Requests IDs for CRs that match a specific criteria?

Would it be QueryData?

I don't want to run a report (in any event, I wouldn't know the report name); I simply want to build a query string on the fly and execute it, and get an API object containing all the Change Request IDs.

I will then use the IDs to fetch individual CR record attributes via the GetCRData API call (later on in my program).

Something like this?

  $csapi->setUpConnection("http", "angler", 8600);
	my $aUser = $csapi->Login("u00001", "u00001", "User", "\\\\angler\\ccmdb\\cm_database");
	my $tmp = $csapi->QueryData($aUser, undef, "(submitter='cschuffe') and (cvtype='problem')", 
		, undef, undef, "problem_number|crstatus");



-Alastair
Report this to a Moderator Report this to a Moderator
 13-Nov-2006 11:54
User is offline View Users Profile Print this message


Michael Bourla

Posts: 10
Joined: 24-Jul-2003

We specify "Basic Summary" for the report name, and either get the CR attributes direct from the QueryData(), or as you say get them later using GetCRData().

Hope this helps.
Michael

Method 1
----------

my $tmp = $csapi->QueryData($aUser, "Basic Summary", "(submitter='cschuffe') and (cvtype='problem')", undef, undef, undef, "problem_number|crstatus");
for(my $i = 0; $i < $tmp->getDataSize(); $i++)
{
my $obj_vec = $tmp->getDataObject($i);
$status = $obj_vec->getDataObjectByName("crstatus")->getValue();
}


Method 2
-----------

my $tmp = $csapi->QueryData($aUser, "Basic Summary", "(submitter='cschuffe') and (cvtype='problem')", undef, undef, undef, "problem_number|crstatus");
for(my $i = 0; $i < $tmp->getDataSize(); $i++)
{
my $problem_number = $tmp->getDataObject($i)->getDataObjectByName("problem_number")->getValue();
(undef, $CR_id) = split /\#/, $problem_number; # remove the DB prefix and DCM delimiter (assumed to be #)
$tmp2 = $csapi->GetCRData($aUser, $CR_id, "problem_number|crstatus");
$status = $tmp2->getDataObjectByName("crstatus")->getValue();
};
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.