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

Gene LeDuc gleduc at mail.sdsu.edu
Thu Aug 23 12:18:20 EDT 2007


Hi Sean,

Here's my understanding of what you're trying to do:
1.  Ticket comes in to default incoming queue.
2.  An admin sees it and changes the Owner to himself.
3.  The ticket moves into the admin's personal queue.

If that is it, there's a pretty simple way to do this.  Use your "On Owner 
Change" scrip and replace the actions stuff with this.  It should move the 
ticket into a queue that has the same name as the ticket owner.

$self->TicketObj->SetQueue($self->TicketObj->OwnerObj->Name);

If your objective is something else, could you clarify that for me?

Regards,
Gene

At 06:28 PM 8/22/2007, Sean wrote:
>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/
>_______________________________________________
>http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
>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