[rt-users] Scripting Custom conditions and actions
Mahoney, Tim
Tim.Mahoney at magicorp.com
Fri Sep 16 11:22:47 EDT 2005
I've got the code written, but it's not working. The scrip is based on
http://wiki.bestpractical.com/index.cgi?AutoSetOwner.
Description: AutoChangeQueue
Condition: On Create
Custom condition:
Action: User Defined
Custom action preparation code: return 1;
Custom action cleanup code:
# get out unless subject is Pursuant
return 1 unless $self->TicketObj->Subject = 'Pursuant';
# ok, try to change queue
$RT::Logger->info("Auto transfer ticket #". $self->TicketObj->id ." to the
Pursuant Queue" );
my ($status, $msg) = $self->TicketObj->SetQueue( '8' );
unless( $status ) {
$RT::Logger->warning( "Impossible to change Queue" );
return undef;
}
return 1;
No history in the log to indicate it couldn't change queue, so I'm thinking
the Subject condition failed. Thanks, Iris, for pointing me in the right
direction.
Thanks,
Tim
972-980-4991
________________________________
From: Brookes, Iris [mailto:Iris.Brookes at tdsecurities.com]
Sent: Thursday, September 15, 2005 4:19 PM
To: Mahoney, Tim
Subject: RE: [rt-users] Scripting Custom conditions and actions
Have a look at the code here:
http://wiki.bestpractical.com/index.cgi?AutoChangeQueue
Regards,
Iris Brookes
-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com
[mailto:rt-users-bounces at lists.bestpractical.com]On Behalf Of Mahoney, Tim
Sent: Thursday, September 15, 2005 4:41 PM
To: rt-users at lists.bestpractical.com
Subject: [rt-users] Scripting Custom conditions and actions
I need to create a scrip that when a ticket is autocxreated
from email with a specific word in the subject, it is moved to a specific
queue.
In Pigeon language here are how it should work
Condition
If subject LIKE 'pursuant'
Action
make queue = 'Pursuant'
I'm a n00b when it comes to scripting, especially in RT.
Any help would be greatly appreciated.
Thanks
Tim Mahoney
Win Svr 2003 / RT 3.0.12 / Apache 1.33 / Perl 5.8.6 / MySQL
4.1.18
More information about the rt-users
mailing list