Using the following script I will on occasion get "Deep recursion on anonymous
subroutine". I am one not sure what this means and two I do not have any idea
how to fix it.
Looking for some ideas from the experts. Thanks.
sub Commit
{
my $self = shift;
my $ticket = $self->TicketObj;
my $datecreated = $ticket->CreatedObj->Unix;
my $datestarted = $ticket->Started;
my ($styyyy, $stmm, $stdd, $sthh, $stmn, $stss) = $datestarted =~
/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/;
my $dateresolved;
my $timeworded;
my $isodateresolved;
my $transactions = $ticket->Transactions;
$transactions->Limit( FIELD => 'Type', VALUE => 'Status', FIELD =>
'NewValue', VALUE => 'closed');
# $transactions->Limit( FIELD => 'Type', VALUE => 'EmailRecord' );
while (my $transaction = $transactions->Next)
{
#print "Found Transaction\n";
if (defined $transaction->CreatedObj->Unix)
{
$isodateresolved = $transaction->CreatedObj->ISO;
my ($yyyy, $mm, $dd, $hh, $mn, $ss) = $isodateresolved =~
/(\d+)-(\d+)-(\d+) (\d+):(\d+):(\d+)/;
my ($defdays, $defhours, $defminutes, $defseconds) =
Delta_DHMS($styyyy, $stmm, $stdd, $sthh, $stmn, $stss,
$yyyy, $mm, $dd, $hh, $mn, $ss); # later
my $timeworded = ($defdays * 24 * 60) + ($defhours * 60) +
$defminutes;
if ($timeworded < 1)
{
$timeworded = 1;
}
$ticket->SetResolved($isodateresolved);
$ticket->SetTimeWorked($timeworded);
$RT::Logger->debug("Update Resolved on Closed Ticket script
Complete for ticket " . $ticket->Id . "\n");
}
}
return 1;
Bryon Baker
Network Operations Manager
Copesan - Specialists in Pest Solutions
800-267-3726 Ext. 2296 * 262-783-6261 Ext. 2296
[email protected]
www.copesan.com
"Servicing North America with Local Care"
---------
RT 4.4 and RTIR Training Sessions https://bestpractical.com/training
* Los Angeles - September, 2016