[rt-users] Linking a Transaction CF value to a Ticket CF value

scott.dalzell scott.dalzell at aveva.com
Mon Jul 8 05:12:38 EDT 2013


Ah ok i see where the syntax error is coming from and your right its because
of a missing bracket.

I have now ran the trigger by replying to a ticket and setting the
'Alert_Support_T CF to 'Alert' and it produced the following error

*Error Log*
Stack:
  [/opt/rt4/sbin/../lib/RT/Interface/Email.pm:487]
  [/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:292]
  [/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:114]
  [/opt/rt4/sbin/../lib/RT/ScripAction.pm:232]
  [/opt/rt4/sbin/../lib/RT/Scrip.pm:475]
  [/opt/rt4/sbin/../lib/RT/Scrips.pm:188]
  [/opt/rt4/sbin/../lib/RT/Transaction.pm:201]
  [/opt/rt4/sbin/../lib/RT/Record.pm:1504]
  [/opt/rt4/sbin/../lib/RT/Ticket.pm:2297]
  [/opt/rt4/sbin/../lib/RT/Ticket.pm:2193]
  [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:2019]
  [/opt/rt4/share/html/Ticket/Display.html:164]
  [/opt/rt4/share/html/Ticket/Update.html:300]
  [/opt/rt4/share/html/Ticket/autohandler:66]
  [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:634]
  [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:335]
  [/opt/rt4/share/html/autohandler:53]
(/opt/rt4/sbin/../lib/RT/Interface/Email.pm:491)
[Mon Jul  8 09:01:35 2013] [warning]: Couldn't load object RT::Transaction
#0 (/opt/rt4/sbin/../lib/RT/Interface/Web.pm:2684

*Script Cndition*

#Set my Variables
 my $txn = $self->TransactionObj;
 my $type = $txn->Type;
 my $cf = RT::CustomField->new( $self->CurrentUser );


#Test load CF Alert_Support_T
my ($id, $msg) = $cf->Load("Alert_Support_T"); 
unless ($id) { 
    RT->Logger->error("Unable to load Alert_Support_T: $msg"); 
    return 0; 
}
 
if ( $type eq 'Create' ) {
     # CF can be set on create
     return 0 unless
$txn->Creatorobj->FirstCustomFieldValue('Alert_Support_T') eq 'LFM Support
Required';

} 
elsif ( $type eq 'CustomField' ) {
     # CF can be changed later
     my $cf = RT::CustomField->new( $self->CurrentUser );
     $cf->Load( $txn->Field );
   
     return 0 unless $cf->Name eq 'Alert_Support_T';
     return 0 unless $txn->NewValue eq 'LFM Support Required';
 } else {
     return 0;
 }
 return 1;




--
View this message in context: http://requesttracker.8502.n7.nabble.com/Linking-a-Transaction-CF-value-to-a-Ticket-CF-value-tp54546p54593.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.



More information about the rt-users mailing list