Priority Based Scrip

I’m in need of a scrip that will check the ticket as
it’s created and if
it’s priority is 4 or greater than e-mail
‘charliebrown@snoopy.com’
This is what I’ve started with. I just copied and
pasted from an hour
script I found so I don’t know if it is in any way
correct. Anyone’s
help would be awesome. I’ll even buy you lunch if you
get out to
Vegas. :slight_smile:

package RT::Condition::Priority;
 
use strict;
use base 'RT::Condition::Generic';
 
sub IsApplicable {
    my $self = shift;
 
    return 0 unless $self->TicketObj->Priority >=

4;

    return 1;
}
 
1;

Start your day with Yahoo! - Make it your home page!

Phanoko wrote:

I’m in need of a scrip that will check the ticket as
it’s created and if
it’s priority is 4 or greater than e-mail
‘charliebrown@snoopy.com’
This is what I’ve started with. I just copied and
pasted from an hour
script I found so I don’t know if it is in any way
correct. Anyone’s
help would be awesome. I’ll even buy you lunch if you
get out to
Vegas. :slight_smile:

package RT::Condition::Priority;
 
use strict;
use base 'RT::Condition::Generic';
 
sub IsApplicable {
    my $self = shift;
 
    return 0 unless $self->TicketObj->Priority >=

4;

    return 1;
}
 
1;

This code doesn’t work if you are running rt >= 3.5.5.
When the condition is checked, the priority is not set yet.