New to RT , Owners and Queues

Hi Guys, need a little help. We have setup RT to keep tabs on peoples workload. in short we would like to make it automatically move a ticket to a queue based on who took it or who it was assigned to.

Or said differently each queue is for a person and should reflect who the owner is.

How do i do this.

Thx in advance.

You can write a scrip Admin->Scrips->Create and use the “On owner change” condition and have a custom action that sets the tickets queue value to whichever queue it should be.

Although it may be worth asking why you want a queue for each user, it would seem to me that one queue would be enough and you can use saved searches to see the tickets that each user owns in the main queue

Thanks for getting back to me. Yes i did think i could use the scrip “On Owner Change” but to be blunt I don’t know how to write the scrip to go in there. What i am after is something like this

If owner = “User.Name1” set queue = “Name1” else
If owner = “User.Name2” set queue = “Name2” else
If owner = “User.Name3” set queue = “Name3” end.

I just don’t know how to write it. As for you question as to why 1 queue for each person, the answer is our Boss is a little anal retentive , he likes things a particular way

Thanks again.

As for you question as to why 1 queue for each person, the answer is our Boss is a little anal retentive , he likes things a particular way

Fair enough! Yeah going off of memory I believe this should be enough to get you started (Scrips are Perl BTW so that is the syntax)

my %UserToQueue = (
    'Username 1'   => 'Queue 1',
    'Username 2'   => 'Queue 2'
);

my $new_queue = $UserToQueue{$self->TicketObj->OwnerObj->Name);

my ($ret, $msg) = $self->TicketObj->SetQueue($new_queue);
RT::Logger->error("Could not set queue to $new_queue: $msg") unless $ret;

return $ret

To perhaps explain another reason why one might use Queues: one of the included searches on the default RT home page (for each user when they login) shows a Queue display with counts of New, Open and Stalled tickets in each Queue (at least, this is what I saw in RT 4.4.3). I know that trying to create a search applet that shows the same info by user instead was a little too much effort to create.

You don’t need to write any code to have some nice dashboard with all the tickets based on user, instead you can have a dashboard with multiple saved searches Active tickets owned by User1, Active tickets owned by User2 and so on

True, but it didn’t look as nice and compact as the included default applet. (If I’m mistaken, please correct me so I can finally change our RT to assign tickets by User and do away with Queues! :slight_smile: )

image

That is true, it could get confusing with applying scrips/custom fields and rights but if your use case isn’t too crazy with all that then you should be fine

1 Like

Thx Knation, i took your scrip and put in into RT and then tested. I am sure i have done something wrong because it didnt work .
I created a Global scrip with this content.

The last thing i did was (after RT complained) the end ) from your scrip to } on the line

$UserToQueue{$self->TicketObj->OwnerObj->Name)

Should they all be { or ( braces or a mix and match??

You probably want a:

return 1;

in the custom action preparation code box, so that it fires no matter what. For more information on writing custom scrips see the wiki page on it.

Thanks Guys, Your all awesome, works like a charm.