Access Keys:
Skip to content (Access Key - 0)

How can I automatically make the first responder the Owner of a Ticket?

  • How can I configure my Request Tracker (RT) queue to automatically assign a ticket to the first person who replies to it?
  • How can I add a Scrip to my Queue that sets the Ticket Owner to the first person to Correspond with the Requestor?

Context

  • Request Tracker (RT) 4.0
  • Ticket tracking at MIT
  • Queue administrators in RT on help.mit.edu

Answer

If you have your Request Tracker (RT) queue set up to notify staff of new tickets as they come in, and staff sometimes or always respond to the Requestor via email rather than going into RT and responding via the web interface, it can be quite useful to automatically make the first staff member to respond to a request the Owner of that ticket. This can be done through a "scrip" attached to your queue.

Writing custom Perl code in Scrips
Please note that, even as a queue administrator, you may not have permission to create user defined actions and conditions in your scrip. Using this functionality requires in-depth understanding of RT and knowledge of Perl, and is not a right automatically granted to queue administrators. Please contact tooltime@mit.edu if you would like us to set this up for you on your queue, or if you'd like to talk about expanded queue administrator permissions.

Steps to set this scrip up for a queue

  1. Hover your mouse over the "Tools" expanding nav button and select "Configuration", then "Queues", then "Select" from the menu that pops up
  2. Find your queue in the list of queues when it finishes loading, and click on it
  3. Hover your mouse over the "Scrips" expanding nav button and select "Select"
  4. Visually inspect the list of scrips that currently apply to your queue to refresh your memory on the notifications and automatic actions already in place for your queue
  5. Hover your mouse over the "Scrips" expanding nav button again and select "Create"
  6. On the form page to create a new scrip, verify that you can see a section titled "User Defined conditions and actions"; if you do not see this section, you cannot complete these instructions yourself and need to request that this be set up for you by sending mail to tooltime@mit.edu
  7. If you can see the section titled "User Defined conditions and actions" then proceed to fill out the new scrip form as follows:
    1. In the section "Scrip fields":
      1. Description = On Correspond set Owner to the Current User if possible
      2. Condition = On Correspond
      3. Action = User Defined
      4. Template = Global Template: Blank
      5. Stage = TransactionCreate
    2. In the section "User Defined conditions and actions":
      1. Leave the box "Custom condition" blank
      2. In the box "Custom action preparation code" enter:
        return 1;
      3. In the box "Custom action cleanup code" enter:
        my $Actor = $self->TransactionObj->Creator;
        return 1 if $Actor == $RT::SystemUser->id;
        return 1 unless $self->TicketObj->Owner == $RT::Nobody->id;
        $RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #". $Actor );
        my ($status, $msg) = $self->TicketObj->SetOwner( $Actor );
        unless( $status ) {
          $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" );
          return undef;
        }
        return 1;

Caveats

How the Scrip works/succeeds/fails

This Scrip will trigger on every Correspondence, but will exit quickly and silently if a) the Ticket already has an Owner set or b) the Correspondence is created by someone who's not a valid Actor on the ticket (i.e. SystemUser). If the Correspondence is created by a valid Actor, but the Actor does not have permissions to own tickets in this queue, the Scrip will also fail but an error will be logged. This can happen if the Requestor sends a follow-up message (Correspondence) to the ticket before any staff members reply to the initial message.

For email Correspondence, RT will use the sender information to determine the Actor. This means you need to send your Reply from the email address associated with your RT user record. This is usually your @mit.edu address, but may be a different if you haver associated a different address, for example your @media.mit.edu or your Gmail address, with your entry in the MIT directory.

Notifications

You may want to enable Owner notifications for your RT queue if you turn this on. In particular, you may want to add the stock Scrip On Owner Change Notify Owners with template Owner Change to your queue if it is not already there. Any staff who also have "Notify Actor" set to "Yes" in their personal options will then receive a short email confirmation that the ticket was successfully assigned to them on their initial reply.

See also

IS&T Contributions

Documentation and information provided by IS&T staff members


Last Modified:

August 29, 2013

Get Help

Request help
from the Help Desk
Report a security incident
to the Security Team
Labels:
request_tracker request_tracker Delete
c-request-tracker c-request-tracker Delete
c-rt-queue-admin c-rt-queue-admin Delete
c-rt-enduser-ownership-assignment c-rt-enduser-ownership-assignment Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
Feedback
This product/service is:
Easy to use
Average
Difficult to use

This article is:
Helpful
Inaccurate
Obsolete
Adaptavist Theme Builder (4.2.3) Powered by Atlassian Confluence 3.5.13, the Enterprise Wiki