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: Delete multiple CRs - Delete CRs - delete change requests
Topic Summary:
Created On: 16-Sep-2004 00:39
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 Justin Mulhearn, on Thursday, September 16, 2004 2:14 AM

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 $@;
}

----------------------------------
 16-Sep-2004 00:39
User is offline View Users Profile Print this message


Justin Mulhearn

Posts: 6
Joined: 8-Apr-2004

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
Report this to a Moderator Report this to a Moderator
 16-Sep-2004 02:14
User is offline View Users Profile Print this message


Justin Mulhearn

Posts: 6
Joined: 8-Apr-2004

Answer 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 $@;
}

----------------------------------
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.