Q: How do I set up my queue to automatically make the creator the owner of a ticket?
- How can I configure my Request Tracker (RT) queue to automatically assign a ticket to the person who creates it?
Answer
If you have a workflow in your team using Request Tracker where every ticket is assigned to someone before it is worked on, or if your queue is set up to use the "Owner Lock" feature in MIT's RT instance, then it may be helpful to you to configure your queue to automatically assign a new ticket to its creator if the ticket is created via the web interface. This can be done through a "scrip" attached to your queue.
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
- Hover your mouse over the "Tools" expanding nav button and select "Configuration", then "Queues", then "Select" from the menu that pops up
- Find your queue in the list of queues when it finishes loading, and click on it
- Hover your mouse over the "Scrips" expanding nav button and select "Select"
- 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
- Hover your mouse over the "Scrips" expanding nav button again and select "Create"
- 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
- If you can see the section titled "User Defined conditions and actions" then proceed to fill out the new scrip form as follows:
- In the section "Scrip fields":
- Description = On Web Create set Owner to Current User if possible
- Condition = On Web Create
- Action = User Defined
- Template = Global Template: Blank
- Stage = TransactionCreate
- In the section "User Defined conditions and actions":
- Leave the box "Custom condition" blank
- In the box "Custom action preparation code" enter:
return 1;
- In the box "Custom action cleanup code" enter:
# get actor ID my $Actor = $self->TransactionObj->Creator; # if actor is RT_SystemUser then get out of here return 1 if $Actor == $RT::SystemUser->id; # get out unless ticket owner is nobody return 1 unless $self->TicketObj->Owner == $RT::Nobody->id; # ok, try to change owner $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;
- Click the button labeled "Create" to create the scrip
- In the section "Scrip fields":
See also
- This article borrows liberally from the contributions to the Best Practical RT wiki at http://requesttracker.wikia.com/wiki/AutoSetOwner.