[rt-users] approvals generating exception

Iain Pople iain at webcentre.unimelb.edu.au
Sun Oct 24 21:31:31 EDT 2004


Hi,

I have setup a Scrip to generate approvals. However it seems to be 
creating an exception in RT.

The Custom Condition for the scrip is as follows:

return undef unless ($self->TransactionObj->Type eq 'Create');
my $impact = $self->TicketObj->FirstCustomFieldValue('3. high impact?');
return undef unless (
   $impact =~ /Y/i
);
return 1;

the Action is to create a ticket using the following template:

===Create-Ticket: changereview
Subject: High Impact Change review for {$Tickets{'TOP'}->Subject}
Depended-On-By: {$Tickets{'TOP'}->Id}
Queue: toplevel maintenance
Type: Approval
AdminCc: me at company.com
Content: A high impact change needs your approval. Please login to the 
RT system and click on the Approvals menu link.
ENDOFCONTENT

It succesfully creates the approval ticket but when i click on the 
approval ticket i get the following:

Tickets which depend on this approval:
  	

System error
error:  	Can't call method "Next" on an undefined value at 
/usr/local/share/rt/share/html/Ticket/Elements/ShowAttachments line 87, 
<GEN36> line 127.
context:  	
...  	
83:  	
84:  	<%INIT>
85:  	my %documents;
86:  	
87:  	while ( my $attach = $Attachments->Next() ) {
88:  	next unless ($attach->Filename());
89:  	unshift( @{ $documents{ $attach->Filename } }, $attach );
90:  	}
91:  	
...  	
code stack: 
/usr/local/share/rt/share/html/Ticket/Elements/ShowAttachments:87
/usr/local/share/rt/share/html/Ticket/Elements/ShowSummary:90
/usr/local/share/rt/share/html/Approvals/Elements/ShowDependency:47
/usr/local/share/rt/share/html/Approvals/Display.html:40
/usr/local/share/rt/share/html/autohandler:221
raw error






























Can't call method "Next" on an undefined value at 
/usr/local/share/rt/share/html/Ticket/Elements/ShowAttachments line 87, 
<GEN36> line 127.


Trace begun at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Exceptions.pm line 131
HTML::Mason::Exceptions::rethrow_exception('Can\'t call method "Next" on 
an undefined value at 
/usr/local/share/rt/share/html/Ticket/Elements/ShowAttachments line 87, 
<GEN36> line 127.^J') called at 
/usr/local/share/rt/share/html/Ticket/Elements/ShowAttachments line 87
HTML::Mason::Commands::__ANON__('Ticket', 'RT::Ticket=HASH(0x93b7c80)', 
'Attachments', undef) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Component.pm line 134
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x956b5c8)', 
'Ticket', 'RT::Ticket=HASH(0x93b7c80)', 'Attachments', undef) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1074
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1068
HTML::Mason::Request::comp(undef, undef, 'Ticket', 
'RT::Ticket=HASH(0x93b7c80)', 'Attachments', undef) called at 
/usr/local/share/rt/share/html/Ticket/Elements/ShowSummary line 90
HTML::Mason::Commands::__ANON__('Ticket', 'RT::Ticket=HASH(0x93b7c80)') 
called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Component.pm line 134
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x94e9cb8)', 
'Ticket', 'RT::Ticket=HASH(0x93b7c80)') called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1074
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1068
HTML::Mason::Request::comp(undef, undef, undef, 'Ticket', 
'RT::Ticket=HASH(0x93b7c80)') called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1113
HTML::Mason::Request::scomp('HTML::Mason::Request::CGI=HASH(0x8fb5734)', 
'/Ticket/Elements/ShowSummary', 'Ticket', 'RT::Ticket=HASH(0x93b7c80)') 
called at 
/usr/local/share/rt/share/html/Approvals/Elements/ShowDependency line 47
HTML::Mason::Commands::__ANON__('Ticket', 'RT::Ticket=HASH(0x956da40)') 
called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Component.pm line 134
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x94093b0)', 
'Ticket', 'RT::Ticket=HASH(0x956da40)') called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1074
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1068
HTML::Mason::Request::comp(undef, undef, 'Ticket', 
'RT::Ticket=HASH(0x956da40)') called at 
/usr/local/share/rt/share/html/Approvals/Display.html line 40
HTML::Mason::Commands::__ANON__('id', 77, 'id', 77) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Component.pm line 134
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x94152a4)', 
'id', 77, 'id', 77) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1074
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1068
HTML::Mason::Request::comp(undef, undef, 'id', 77, 'id', 77) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 760
HTML::Mason::Request::call_next('HTML::Mason::Request::CGI=HASH(0x8fb5734)', 
'id', 77) called at /usr/local/share/rt/share/html/autohandler line 221
HTML::Mason::Commands::__ANON__('id', 77) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Component.pm line 134
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x92717b8)', 
'id', 77) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1069
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 1068
HTML::Mason::Request::comp(undef, undef, undef, 'id', 77) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 338
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 338
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Request.pm line 297
HTML::Mason::Request::exec('HTML::Mason::Request::CGI=HASH(0x8fb5734)') 
called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/CGIHandler.pm line 197
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/CGIHandler.pm line 197
HTML::Mason::Request::CGI::exec('HTML::Mason::Request::CGI=HASH(0x8fb5734)') 
called at /usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/Interp.pm 
line 207
HTML::Mason::Interp::exec(undef, undef, 'id', 77) called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/CGIHandler.pm line 127
eval {...} at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/CGIHandler.pm line 127
HTML::Mason::CGIHandler::_handler('HTML::Mason::CGIHandler=HASH(0x8ea8e30)', 
'HASH(0x927b6d0)') called at 
/usr/local/perl-5.8.4/lib/site_perl/5.8.4/HTML/Mason/CGIHandler.pm line 76
HTML::Mason::CGIHandler::handle_cgi_object('HTML::Mason::CGIHandler=HASH(0x8ea8e30)', 
'CGI::Fast=HASH(0x90a5dec)') called at 
/usr/local/share/rt/bin/mason_handler.fcgi line 75
eval {...} at /usr/local/share/rt/bin/mason_handler.fcgi line 75



More information about the rt-users mailing list