[rt-users] Re: Autoassign User based on Email Address

Gene LeDuc gleduc at mail.sdsu.edu
Tue Dec 4 15:18:07 EST 2007


Hi Max,

This is possible and probably not too difficult.

You can get the "To:" addresses from the original e-mail using:
     my @OriginalTo = 
$self->TicketObj->Transactions->First->Attachments->First->GetHeader('To');

or if this is an "On Create" scrip, you might be able to use (this is 
untested):
     my @OriginalTo = $self->TransactionObj->GetHeader('To');

This will give you an array @OriginalTo of all the addresses that were on 
the "To:" header.  If the e-mail had several addresses then you'll have to 
figure out which one you want.

Then do your queue and owner assignments like this:
     $self->TicketObj->SetOwner($username);
     $self->TicketObj->SetQueue("support");

So an e-mail sent to bob at rt.yourcompany.com would end up in your "support" 
queue assigned to user "bob at rt.yourcompany.com".  Warning - This will cause 
RT to try this assignment on _every_ new ticket sent to it.  If this is not 
what you want, then you need to do some conditional checking to make sure 
that the $username is one of your support techs and then bail if it's not 
the case.

This might need some tweaking, but the basic recipe should work.

Regards,
Gene

At 11:08 AM 12/4/2007, Max Clark wrote:
>I've been digging through the wiki but I have yet to find a solution
>to this. Is it possible to autoassign a user based on the to: address?
>I want to be able to send email to foo at rt which will create a ticket
>in the support queue assigned to foo.
>
>Thanks in advance,
>Max
>_______________________________________________
>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:
>
>If you sign up for a new RT support contract before December 31, we'll take
>up to 20 percent off the price. This sale won't last long, so get in touch 
>today.
>     Email us at sales at bestpractical.com or call us at +1 617 812 0745.
>
>
>Community help: http://wiki.bestpractical.com
>Commercial support: sales at bestpractical.com
>
>
>Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
>Buy a copy at http://rtbook.bestpractical.com


-- 
Gene LeDuc, GSEC
Security Analyst
San Diego State University 




More information about the rt-users mailing list