How to assign tickets to a queue based on email address AND subject line?

Hi all,

I am currently trying to sort tickets into a specific queue based on a
specific email address AND subject line. I know some of you will mention
Procmail or some other MDA. I wish to do this with just a perl scrip.

I have assigned tickets to queues based on email address and I have assigned
tickets to queues based on subject lines. However I cannot assign the ticket
to a queue based on a specific email address and subject line together.

Here is the code I am working on. Please help if you can.

my $requestor_address = $self->TicketObj->RequestorAddresses;
my $requestor_subject = $self->TicketObj->Subject;
my $specfic_user = ‘ian.kennedy@hotmail.com’;
my $specific_subject = ‘Help’;
my $target_queue_name = ‘Argus’;

if the ticket email address matches

if ($requestor_address == $specfic_user) {

    # if the ticket email subject matches
    unless ($requestor_subject != $specific_subject) {
    
            # Set the ticket queue
my ($status, $msg) = $self->TicketObj->SetQueue( $target_queue_name );
    }

}

Many thanks,

Aaron

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-assign-tickets-to-a-queue-based-on-email-address-AND-subject-line-tp57586.html

Hi all,

I am currently trying to sort tickets into a specific queue based on a
specific email address AND subject line. I know some of you will mention
Procmail or some other MDA. I wish to do this with just a perl scrip.

I have assigned tickets to queues based on email address and I have assigned
tickets to queues based on subject lines. However I cannot assign the ticket
to a queue based on a specific email address and subject line together.

Here is the code I am working on. Please help if you can.

my $requestor_address = $self->TicketObj->RequestorAddresses;
my $requestor_subject = $self->TicketObj->Subject;
my $specific_user = ‘ian.kennedy@hotmail.com’;
my $specific_subject = ‘Help’;
my $target_queue_name = ‘Argus’;

if the ticket email address matches

if ($requestor_address == $specific_user) {

    # if the ticket email subject matches 
    if ($requestor_subject == $specific_subject) { 
    
            # Set the ticket queue 
my ($status, $msg) = $self->TicketObj->SetQueue( $target_queue_name ); 
    } 

}

Many thanks,

Aaron

View this message in context: http://requesttracker.8502.n7.nabble.com/How-to-assign-tickets-to-a-queue-based-on-email-address-AND-subject-line-tp57587.html

I am currently trying to sort tickets into a specific queue based on a
specific email address AND subject line. I know some of you will mention
Procmail or some other MDA. I wish to do this with just a perl scrip.

This is truly the right way to do this, since without it, triggering
the correct Autoreply is a pain.

If you cannot do it the right way, you may wish to build on the code I
wrote for someone else with the same restrictions

if the ticket email address matches

if ($requestor_address == $specific_user) {

    # if the ticket email subject matches 
    if ($requestor_subject == $specific_subject) { 

== is the numeric comparison, eq is the string comparison

perl -le ‘print “two” == “three” ? “yes” : “no”’
perl -le ‘print “two” eq “three” ? “yes” : “no”’

-kevin