[rt-users] RT4.0.4 Custom Scrip Guidance

Ronald J. Yacketta yacketrj at potsdam.edu
Thu Jan 26 09:38:58 EST 2012


On 1/26/2012 8:38 AM, Ronald J. Yacketta wrote:
> All,
>
> We have an external perl script that trolls through the RT MySQL DB 
> looking for recent transactions with a specific CF that has been 
> updated. The script will pull out specific data from the DB and update 
> an External Site for notifications. The script is used to inform the 
> campus when we are planning server maintenance or are working on a 
> issue that impacts the campus.
>
> Would like to convert the external perl script into a RT Custom Scrip 
> that acts upon 'Correspond' || 'Comment' && CF modification, when 
> those conditions are met the Custom Action will call an external perl 
> script with appropriate data to update the notification www site.
>
> Have the following (based on 
> http://requesttracker.wikia.com/wiki/OnCustomFieldValueChange) which 
> throws 'RT: Couldn't load object RT::Transaction #0 
> (/opt/rt4/sbin/../lib/RT/Interface/Web.pm:2164)' in the log
>
> unless (
> (  ($self->TransactionObj->Type eq "Correspond"
>  || $self->TransactionObj->Type eq "Comment")
> &&  $self->TransactionObj->Field == 18 )
> ) {
>    return 0;
> }
>
> return 0 unless $self->TicketObj->FirstCustomFieldValue('External 
> Updates') =~ /Public Status/i;
>
> 1;
>
> Regards,
>
> Ron
>
>
> --------
> RT Training Sessions (http://bestpractical.com/services/training.html)
> * Boston  March 5 & 6, 2012

A little more background

The CF was created as such:
Type: Select One value
Request Type: Select Box
Applies To: Ticket Transactions
Values:
Change Log
Public Status
Private Status

Script created as such:
Condition: User Defined
Action: User Defined
Template: Blank
Stage:TransactionCreate

Not sure it is a Scrip issue, I modified the script and put "1;" in each 
box and still get the log message. Also tried with each box being empty, 
no joy same log message.





More information about the rt-users mailing list