![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
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 |
![]() |
![]()
|
![]() |
|
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"); |
|
![]() |
|
![]() |
|
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(); }; |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.