Scrip Help needed (grabbing Organization)

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/

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/


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@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

Sean,

Why go through all that? Why not give each AdminCc of each different 

queue the right to “SeeQueue”, ShowTicket", “ModifyTicket”,
“CommentOnTicket” in the general queue where all the tickets are held
originally (maybe create a group named “QueueAdmin” for that purpose
alone) that way they can find tickets they should work on in the general
Queue and make a comment and change the queue (and maybe even assign an
owner) all at once for any particular ticket so someone in the
support-group that works on tickets in the new queue can take it. Either
way, the ticket has been moved without the need of scrips or custom
fields. BTW, the correct message would be “Ticket taken …”. I either
don’t understand the question or the nned or both. ??

Kenn
LBNL

Sean wrote:

This did it.

It was actually that we have a default incoming queue, and certain team members
are say, unix, and others are network, so when someone in the network team took
at ticket, it would move to the network queue (vs. having their own personal queue)
so i am storing the value of the queue (unix, network, etc…) in the “Organization” field, so
I took your snippet below:

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

and changed it to:

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

Thanks a million!!!

-SeanFrom: Gene LeDuc gleduc@mail.sdsu.edu
To: Sean stroke_of_death@yahoo.com; rt-users@lists.bestpractical.com
Sent: Thursday, August 23, 2007 11:18:20 AM
Subject: Re: [rt-users] Scrip Help needed (grabbing Organization)

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/


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@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

Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz

Oh, you’ve found solution, I hope another reply will make things
clearer and help you next day :)On 8/23/07, Sean stroke_of_death@yahoo.com wrote:

This did it.

It was actually that we have a default incoming queue, and certain team members
are say, unix, and others are network, so when someone in the network team took
at ticket, it would move to the network queue (vs. having their own personal queue)
so i am storing the value of the queue (unix, network, etc…) in the “Organization” field, so
I took your snippet below:

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

and changed it to:

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

Thanks a million!!!

-Sean

----- Original Message ----
From: Gene LeDuc gleduc@mail.sdsu.edu
To: Sean stroke_of_death@yahoo.com; rt-users@lists.bestpractical.com
Sent: Thursday, August 23, 2007 11:18:20 AM
Subject: Re: [rt-users] Scrip Help needed (grabbing Organization)

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/


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@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

  ____________________________________________________________________________________

Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search
graduation gifts - Yahoo Search Results


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.