Scrip to unown and change queue so we can keep all queues hidden?

Hi everyone,

I’m curious if anyone has ventured out to build a scrip that would unown a ticket, and reassign to another queue based on a custom field value.

Basically what I was looking for was the ability to hide all other queues from a group of support staff. But when they get a ticket that doesn’t belong to them, they can remove themselves as owners, and put the ticket in the appropriate queue. Now if you have the queues hidden, the only thing I could think of is let the RT-system remove them as owner, and change the queue based off of a custom field value they’d change.

Is it possible?

Has anyone done it?

Thanks!

Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON P7B 5E1
Phone: (807) 766-7331
Email: mike.johnson@normed.ca
Technology assistance: email nosmhelpdesk@normed.ca
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat holidays:
Off campus toll free 1 (800) 461-8777, option 8, or locally either
(705) 662-7120 or (807) 766-7500

Hi Mike,

I haven’t done this, but it sounds pretty straightforward using a scrip.
Have a custom field with 2 possible values, “blank” and “disown”.
Your scrip uses a custom condition that triggers when that field changes
to “disown”. You have the custom action do the owner change (to
nobody), the queue change, and then change the custom field back to
“blank”. The wiki should be able to give you good examples of all three
actions as well as the custom condition.

Regards,
GeneOn 5/13/2010 7:34 AM, Mike Johnson wrote:

Hi everyone,

I’m curious if anyone has ventured out to build a scrip that would unown a ticket, and reassign to another queue based on a custom field value.

Basically what I was looking for was the ability to hide all other queues from a group of support staff. But when they get a ticket that doesn’t belong to them, they can remove themselves as owners, and put the ticket in the appropriate queue. Now if you have the queues hidden, the only thing I could think of is let the RT-system remove them as owner, and change the queue based off of a custom field value they’d change.

Is it possible?

Has anyone done it?

Thanks!

Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON P7B 5E1
Phone: (807) 766-7331
Email: mike.johnson@normed.ca
Technology assistance: email nosmhelpdesk@normed.ca
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat holidays:
Off campus toll free 1 (800) 461-8777, option 8, or locally either
(705) 662-7120 or (807) 766-7500

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

Mike,

Try something like this:

Custom Condition:

my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;

Check the CF for the changed value

if ($trans->Type eq ‘CustomField’)
{
my $cf = new RT::CustomField($RT::SystemUser);
$cf->LoadByName(Queue => $ticket->QueueObj->id,
Name => “NAME OF CF”);
return 0 unless ($cf->id and $approver ne $owner);
if ($trans->Field == $cf->id &&
$trans->NewValue eq “Whatever”)
{
return 1;
}
}

return 0;

Custom Action Prep Code:

set new Ticket Owner value

my $ticket = $self->TicketObj;
$ticket->SetOwner(10, ‘Force’);
return 1;

Custom Action Cleanup Code:

return 1;

This code will change the owner to “Nobody” when the CF is changed. All you
need to do is add the code to change the Queue.

Hope this helps.

Kenn
LBNLOn Thu, May 13, 2010 at 7:34 AM, Mike Johnson Mike.Johnson@normed.cawrote:

Hi everyone,

I’m curious if anyone has ventured out to build a scrip that would unown a
ticket, and reassign to another queue based on a custom field value.

Basically what I was looking for was the ability to hide all other queues
from a group of support staff. But when they get a ticket that doesn’t
belong to them, they can remove themselves as owners, and put the ticket in
the appropriate queue. Now if you have the queues hidden, the only thing I
could think of is let the RT-system remove them as owner, and change the
queue based off of a custom field value they’d change.

Is it possible?

Has anyone done it?

Thanks!

Mike Johnson
Datatel Programmer/Analyst
Northern Ontario School of Medicine
955 Oliver Road
Thunder Bay, ON P7B 5E1
Phone: (807) 766-7331
Email: mike.johnson@normed.ca
Technology assistance: email nosmhelpdesk@normed.ca
Technology Emergency Contact (TEC) Mon-Fri, 8am to 5pm excluding stat
holidays:
Off campus toll free 1 (800) 461-8777, option 8, or locally either
(705) 662-7120 or (807) 766-7500

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