All, I am customizing RT to add an attribute to transactions that meet certain criteria. The script below is meant to update all the existing transactions but after a while the Mysal server goes away. Is there anything obvious about the script causing this? Thanks!
#!/opt/perl/bin/perl use strict; use warnings; use lib qw(/opt/rt3/local/lib /opt/rt3/lib); use RT; use RT::Transactions;; RT::LoadConfig(); RT::Init(); my $last = 1; for my $id ( (500_000, 1_000_000, 1_500_000, 2_000_000, 2_500_000, 3_000_000, 3_500_000, 4_000_000, 4_500_000, 5_000_000, 5_500_000, 6_000_000, 6_500_000, 7_000_000, 7_500_000, 8_000_000, 8_500_000, 9_000_000, 9_500_000, 10_000_000) ) { my $transactions = RT::Transactions->new( $RT::SystemUser ); $transactions->Limit( FIELD => 'ObjectType', VALUE => "RT::Ticket" ); $transactions->Limit( FIELD => 'Type', VALUE => "EmailRecord" ); $transactions->Limit( FIELD => 'id', VALUE => $last, OPERATOR => ">=" ); $transactions->Limit( FIELD => 'id', VALUE => $id, OPERATOR => "<", ENTRYAGGREGATOR => "AND" ); while (my $trans = $transactions->Next) { my $ticket = $trans->Object; if ( $ticket->RequestorIsExternal ) { $trans->SetAttribute( Name => "ExternalEmail", Content => 1); } } $last = $id; } _______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: sa...@bestpractical.com Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com