[rt-users] Scrip Help needed (grabbing Organization)

Sean stroke_of_death at yahoo.com
Wed Aug 22 21:28:20 EDT 2007


Hi,

I am trying to modify one of the contributed scrip's on here which relates to "taking a ticket" and having it automatically go to a certain queue.

We have one queue that all requests go to (i.e. customer facing) and the admins have their own queues of responsibility. I didn't want to screw with custom fields, and because we don't use the information in the customer info page (i.e address etc..) I figured just for the admin's, I would put the queue name in the organization field.

So, here is the scrip, which I have tried for hours to get to work (so there may be some extraneous things here) - Basically, the problem as I see it, is that I can't get the syntax or something correct to get the value in the organization field, as when I set:

$newqueue = "queue1" - the code DOES change the queue, but I can't get it to grab the value in the organization field. 

The scrip is 
Condition: On Owner Change, 
Action: User Defined, 
Template: Global template: blank, 
Stage is TransactionCreate

Script in Custom condition: blank
Scrip in Custom action preparation code: 

return 1

Scrip in action cleanup code:

my $User = new RT::User($RT::SystemUser); 
$User->Load( $User->Organization);
my $newqueue = $User->Organization;
$newqueue = ($User->Organization);
$RT::Logger->info("Ticket took by an admin : new ticket in admin queue"); 
my ($status, $msg) = $self->TicketObj->SetQueue($newqueue); 
$self->TicketObj->SetQueue($newqueue); 
$RT::Logger->info("Set queue to ($newqueue)");
return 1;

Output in /var/log/messages:

Aug 22 21:25:38 rt RT: Ticket took by an admin : new ticket in admin queue ((eva
l 2459):6)
Aug 22 21:25:38 rt RT: Set queue to () ((eval 2459):9)

Thanks for any help.


       
____________________________________________________________________________________
Pinpoint customers who are looking for what you sell. 
http://searchmarketing.yahoo.com/



More information about the rt-users mailing list