[rt-users] scrips behaving differently via mail and web ui

Michael S. Baker mbaker at colltech.com
Mon Sep 22 15:11:51 EDT 2003


Can anyone help me with this? Any kind of assistance would be gladly 
welcomed, including pointers to threads that already discuss this kind 
of problem or even methods of debugging scrips as they pass through the 
different entry points to RT.

Thanks,
Mike

Michael S. Baker wrote:
> I'm running RT 3.0.1 with Apache 1.3.27, mysql 4.0.12, and mod_perl 1.27 
> on a Solaris 8 server.
> 
> I have setup a scrip/template for Approvals and a scrip to process 
> custom fields from email. The scrips are behaving differently depending 
> on the method of entry in to RT, email or web ui.
> 
> The Approval scrip/template works correctly via the web ui, but the 
> custom fields scrip deletes all of the custom fields except one. When 
> the input method is email the custom fields get handled correctly, but 
> the Approval queue isn't set.
> 
> Any ideas what's going on here and how I can fix it? The debug info in 
> the log isn't being helpful, atm.
> 
> Here are the scrips/templates:
> 
> +++Approval Template+++
> ===Create-Ticket: fwapproval
> Subject: Approval for 
> {$Tickets{'TOP'}->FirstCustomFieldValue('Organization')} Firewall 
> Request {$Tickets{'TOP'}->Id}
> Depended-On-By: {$Tickets{'TOP'}->Id}
> Type: Approval
> Queue: {$Tickets{'TOP'}->FirstCustomFieldValue('Organization')}Approvals
> Content: There is a new request from 
> {$Tickets{'TOP'}->RequestorAddresses} requiring your approval.
> You can view the request at the Network Web page or by following this URL:
> http://rtdev.example.com/Ticket/Display.html?id={$Tickets{'TOP'}->Id}
> ENDOFCONTENT
> +++End Approval Template+++
> 
> +++Custom Fields Scrip+++
> my $Ticket = $self->TicketObj;
> my $Transaction = $self->TransactionObj;
> my $field;
> 
> #
> # Get the following custom fields from email headers:
> # Organization, Source, Destination, Ports, Direction
> #
> 
> my @fieldnames = ( 'X-RTOrg', 'X-RTSrc', 'X-RTDst', 'X-RTPort', 
> 'X-RTDir' );
> my %cfields = (
>         'X-RTOrg'=>'Organization',
>         'X-RTSrc'=>'Source',
>         'X-RTDst'=>'Destination',
>         'X-RTPort'=>'Port(s)',
>         'X-RTDir'=>'Direction' );
> 
> foreach $field ( @fieldnames ) {
>         my $mailer = $Transaction->Attachments->First->GetHeader($field);
>         my $cf = new RT::CustomField($RT::SystemUser);
> 
>         $cf->LoadByNameAndQueue(Name=>$cfields{$field}, Queue=>5);
> 
>         $Ticket->AddCustomFieldValue(Field=>$cf, Value=>$mailer);
> }
> +++End Custom Fields Scrip+++





More information about the rt-users mailing list