Assign on reply

I have an email address all my customers use to contact us
(support@). Whenever they send an email to this address, it creates a
ticket. That’s great.

Now I have noc people replying to these emails, which goes through RT
and changes the status of a ticket from new to open when there is a
reply. That’s great.

I want RT to automatically assign the ticket to the person who first
replied to the ticket email. RT needs to be sure that this person is
an RT user. I think that’s what the scrips are for, I’m just not sure
as to how to do it.

Haim Dimer
Systems Administrator
Prolexic Technologies
Office: 866-800-0366 x 1023
Fax: 954-925-6642


hdimer@prolexic.com

I have an email address all my customers use to contact us
(support@). Whenever they send an email to this address, it creates a
ticket. That’s great.

Now I have noc people replying to these emails, which goes through RT
and changes the status of a ticket from new to open when there is a
reply. That’s great.

I want RT to automatically assign the ticket to the person who first
replied to the ticket email. RT needs to be sure that this person is
an RT user. I think that’s what the scrips are for, I’m just not sure
as to how to do it.

You can do this by creating a custom scrip:

Description: Auto take on correspond
Condition: User defined
Action: User defined
Template: Blank
Stage: Transaction Create

Custom Condition:
if ($self->TransactionObj->Type eq “Correspond” or
$self->TransactionObj->Type eq “Comment”) {
return 1;
} else {
return undef;
}

Custom Action Preparation:

return 1;

Custom Action Code:

# get actor ID
my $Actor = $self->TransactionObj->Creator;


# if actor is RT_SystemUser then get out of here
return 1 if $Actor == $RT::SystemUser->id;

# get out unless ticket owner is nobody
return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;

# bail if no right to own ticket
return 1 unless $self->TransactionObj->CreatorObj->HasRight( 
    Object => $self->TicketObj->QueueObj, 
    Right=> 'OwnTicket'
);

# ok, try to change owner
$RT::Logger->info("Auto assign ticket #" . 
    $self->TicketObj->id ." to user #". $Actor );
my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
unless( $status ) {
    $RT::Logger->warning( "Failed to assign to $Actor: $msg" );
    return undef;
}
return 1;

Travis
Travis Campbell - Unix Systems Administrator = travis@mpdtxmail.amd.com
5900 E. Ben White Blvd, Austin, TX 78741 = travis.campbell@amd.com
TEL: (512) 602-1888 PAG: (512) 604-0341 = webmaster@mpdtxmail.amd.com
"Does anything work as expected?" Yes. An axe through the CPU.

http://wiki.bestpractical.com/?Contributions
http://wiki.bestpractical.com/index.cgi?AutoSetOwnerOn 11/9/05, Haim Dimer hdimer@prolexic.com wrote:

I have an email address all my customers use to contact us
(support@). Whenever they send an email to this address, it creates a
ticket. That’s great.

Now I have noc people replying to these emails, which goes through RT
and changes the status of a ticket from new to open when there is a
reply. That’s great.

I want RT to automatically assign the ticket to the person who first
replied to the ticket email. RT needs to be sure that this person is
an RT user. I think that’s what the scrips are for, I’m just not sure
as to how to do it.

Haim Dimer
Systems Administrator
Prolexic Technologies
Office: 866-800-0366 x 1023
Fax: 954-925-6642
www.prolexic.com
hdimer@prolexic.com


http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Buy your copy of our new book, RT Essentials, today!

Download a free sample chapter from http://rtbook.bestpractical.com

Best regards, Ruslan.