![]() |
Telelogic SYNERGY (steve huntington) | ![]() |
Topic Title: Delete multiple CRs - Delete CRs - delete change requests Topic Summary: Created On: 16-Sep-2004 00:39 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Here's the solution that I ended up using. I wrote a small Perl script that loops through and deletes a range of CRs. If one wanted to delete a group returned for a query, then I guess you could just write a script that does a query, stores CRIDs of the resulting CRs into an array, and then traverses the array to delete each corresponding CR. Anyone else know of a better solution? Here's the code I used: ---------------------------------- use ChangeSynergy::csapi; my $csapi = new ChangeSynergy::csapi(); eval { #Set these according to your Installations details my $protocol = "http"; # Web/WWW/Internet protocol my $host = "salesdemo"; # fully qualified host name. my $port = 8602; # port number for the web site. my $userName = "ccm_root"; my $usersPass = "password"; my $usersRole = "User"; my $UNC_DB_Path = "\\\\salesdemo\\ccmdb\\multilifecycle4"; #Set the range of CRs to delete from the database my $firstToDelete = 100; my $lastToDelete = 1400; $csapi->setUpConnection($protocol, $host, $port); my $globals = new ChangeSynergy::Globals(); my $aUser = $csapi->Login($userName, $usersPass, $usersRole, $UNC_DB_Path); my $tmpstr; my $i; for ($i=$firstToDelete; $i<=$lastToDelete; $i++) { print "Attempting to delete CR=" . $i . "\n"; my $tmpstr = $csapi->DeleteChangeRequest($aUser, $i); } }; if ($@) { print $@; } ---------------------------------- | |
![]() |
|
How I can delete an entire batch of CRs that have been returned by a query?
Edited: 16-Sep-2004 at 02:15 by Justin Mulhearn |
|
![]() |
|
![]() |
|
Here's the solution that I ended up using. I wrote a small Perl script that loops through and deletes a range of CRs. If one wanted to delete a group returned for a query, then I guess you could just write a script that does a query, stores CRIDs of the resulting CRs into an array, and then traverses the array to delete each corresponding CR.
Anyone else know of a better solution? Here's the code I used: ---------------------------------- use ChangeSynergy::csapi; my $csapi = new ChangeSynergy::csapi(); eval { #Set these according to your Installations details my $protocol = "http"; # Web/WWW/Internet protocol my $host = "salesdemo"; # fully qualified host name. my $port = 8602; # port number for the web site. my $userName = "ccm_root"; my $usersPass = "password"; my $usersRole = "User"; my $UNC_DB_Path = "\\\\salesdemo\\ccmdb\\multilifecycle4"; #Set the range of CRs to delete from the database my $firstToDelete = 100; my $lastToDelete = 1400; $csapi->setUpConnection($protocol, $host, $port); my $globals = new ChangeSynergy::Globals(); my $aUser = $csapi->Login($userName, $usersPass, $usersRole, $UNC_DB_Path); my $tmpstr; my $i; for ($i=$firstToDelete; $i<=$lastToDelete; $i++) { print "Attempting to delete CR=" . $i . "\n"; my $tmpstr = $csapi->DeleteChangeRequest($aUser, $i); } }; if ($@) { print $@; } ---------------------------------- |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.