I have a scrip that is supposed to modify the ticket owner to "Nobody"
when the ticket is moved to another queue. What I have is:
Name: Mod Owner on Q chg
Condition: On Queue Change
Action: User Defined
Template: Blank
Stage: TransactionBatch
Custom Condition: none
Custom Action Prep Code:
set new Ticket Owner value
my $Ticket = $self->TicketObj;
$Ticket->SetOwner(‘Nobody’);
return 1;
Custom Action Cleanup Code: none
Actually, I also tried it with Return 1: in the prep code and the
modifying code in the cleanup and still no go with either way. Here I
was thinking it would be a simple scrip and I can’t get it to work. I am
also executing a notification scrip for the same condition and it works.
Anyone have an idea on what’s wrong? Thanks.
I have a scrip that is supposed to modify the ticket owner to
“Nobody” when the ticket is moved to another queue. What I have is:
Name: Mod Owner on Q chg
Condition: On Queue Change
Action: User Defined
Template: Blank
Stage: TransactionBatch
Custom Condition: none
Custom Action Prep Code:
set new Ticket Owner value
my $Ticket = $self->TicketObj;
$Ticket->SetOwner(‘Nobody’);
return 1;
Custom Action Cleanup Code: none
Actually, I also tried it with Return 1: in the prep code and the
modifying code in the cleanup and still no go with either way. Here I
was thinking it would be a simple scrip and I can’t get it to work. I am
also executing a notification scrip for the same condition and it works.
Anyone have an idea on what’s wrong? Thanks.
package RT::Action::MyScrip;
use strict;
use warnings;
sub Prepare {
my $self = shift;
return 1;
}
sub Commit {
my $self = shift;
return 1;
}
1;
I have the scrip and action setup but my log is throwing this:
[log]
[Tue May 24 14:08:35 2011] [debug]: Found 1 scrips for TransactionCreate stage with applicable type(s) Create for txn #248 on ticket #41 (/usr/local/lib/perl5/site_perl/5.10.1/RT/Scrips_Overlay.pm:377)
[Tue May 24 14:08:35 2011] [error]: Scrip Prepare 1 died. - Require of RT::Action:: MyScrip failed.
Attempt to reload RT/Action/MyScrip.pm aborted.
Compilation failed in require at (eval 5748) line 3.
When you work on a scrip in a file, you either use DevelMode or
restart web server every time you change the file. DevelMode helps in
most cases, but not always. If you see some error you don’t understand
and DevelMode is enabled, try server restart, error may be different
after that and make sense.On Tue, May 24, 2011 at 6:45 PM, Barry Carlyon barry@barrycarlyon.co.uk wrote:
Seems that my RT is compiling scrips and apache restart rather than at Run time…
Now I’m even more confused as this is not mentioned in the wiki…
Barry Carlyon
Freelance Web Developer
Freelance Lighting/AV Engineer