[rt-users] Scrip to unown and change queue so we can keep all queues hidden?

Kenneth Crocker kfcrocker at lbl.gov
Thu May 13 11:43:27 EDT 2010


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
LBNL
On Thu, May 13, 2010 at 7:34 AM, Mike Johnson <Mike.Johnson at normed.ca>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 at normed.ca
> Technology assistance: email nosmhelpdesk at 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100513/86cca13c/attachment.htm>


More information about the rt-users mailing list