[rt-users] moving a ticket to a queue whose name is the same as the name of the user who just took/stole the ticket

Ruslan Zakirov ruslan.zakirov at gmail.com
Thu Nov 10 11:16:05 EST 2005


On 11/9/05, Thanh Tran <thanh at coral8.com> wrote:
> Newbie here..
> Need help with moving tickets that get taken/stolen..
> Specifically:  When a user takes or steals a ticket, the ticket should
> also get moved to the queue whose name matches the name of the rt user
> who just took/stole the ticket
>
> Assume:  each rt user has a queue whose name matches the rt user's username.
"You shouldn't want to do it" (c)

>
> This could be done via scrip, I think.
Code should be something like this(note tested):
my $actor_name = $Ticket->CreatorObj->Name;
my $queue = RT::Queue->new( $RT::SystemUser );
$queue->Load( $actor_name );
unless( $queue->id ) {
    $RT::Logger->info( "couldn't load queue '$actor_name'" );
    return 0;
}
my ($status, $msg) = $Ticket->SetQueue( $queue->id );
unless( $status ) {
    $RT::Logger->info( "couldn't set queue: $msg" );
    return 0;
}
return 1;

For more info read wiki.

>
> But, I need help with the scrip that does what I want.
>
> Thanks in advance!
> Thanh
> _______________________________________________
> 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.



More information about the rt-users mailing list