Moving and freeing tickets with 1 button

Hi,

We have a contractor that has access to one queue in our system, once they’ve completed their actions on tickets in this queue, they have to return it to our queue and assign it to nobody. I considered making a scrip that assigns any case moved from contractors queue to our queue to nobody, but to make things really easy for the contractor, I would like a button next to the “Comment” and “Reply” links, that said “Return ticket” or something. It should only apply to this one queue and when clicked return the ticket to our queue and assign it to nobody.

I think I would be able to hack my way through this, but I’m a bit nervous about involving too many aspects of code and was hoping someone had done something similar before and could give me some hints?

Cheers, Bjørn

Hi

Bjørn Skovlund Rydén wrote:

Hi,

We have a contractor that has access to one queue in our system, once
they’ve completed their actions on tickets in this queue, they have
to return it to our queue and assign it to nobody.

I’ve done something like this.

Took a local copy of html/Ticket/Elements/ShowTransaction, and added the
following lump to the end:

my $group = RT::Group->new($RT::SystemUser);
$group->LoadUserDefinedGroup(‘development’);
my $principal = new RT::Principal($Transaction->TicketObj->CurrentUser);
$principal->Load($Transaction->TicketObj->CurrentUser->id);
if ( $group->HasMemberRecursively( $principal ) ) {
$titlebar_commands .=
"<a href="".$DisplayPath."?id="
. $Transaction->Ticket
. “&Queue=support”
. “”>"
. loc(‘Return’)
. “]”;

This will show a ‘Return’ link only to people in the 'development’
group; when clicked it instantly moves the ticket into the 'support’
queue. I’m not certain, but you may be able to add a '&Owner=Nobody’
after the Queue bit.

Alternatively, what may be more efficient is to add another link to the
’Reply Resolve Take …’ menu in the top right: take a local copy of
html/Ticket/Elements/Tabs and add another link through there; I’ve got
an ‘instant resolve’ link:

if ( $Ticket->CurrentUserHasRight(‘ModifyTicket’) ) {
if ( $Ticket->Status ne ‘resolved’ ) {
$actions->{‘B’} = {
path => “Ticket/Display.html?Status=resolved&id=” . $id,
title => loc(‘Resolve’) };
}
}

Cheers
Toby