Scrip - Autoclose on Admin reply

Hi list,

I’m looking for some guidance on setting up a scrip to provide a odd bit
of functionality.

  1. New email comes in.
  2. Auto assigned to queue.
  3. Auto-response goes to requester
  4. Auto-notification goes to watchers
  5. Watcher responds via email (thunderbird/outlook etc)
  6. RT pushes response to requester
  7. Custom Scrip sees that 5) came from a static list (or list of users
    in RT) and resolves the ticket.

Links to documentation or even a code sample would be greatly
appreciated. I’ve gone through wiki.bestpractical.com without much
success, but if there is “THE” page there, please link me :slight_smile:

Regards,

Jason Clarke

Hi Jason,

We use something similar that you can probably mod as needed. If a
queue admin replies to a ticket with an “OK”, the owner is set to the
sender and the ticket is resolved. We use the Priority field of tickets
as a workflow tag; in this case, assigning it a value of 20 triggers
another scrip that sends out the “resolved” e-mail. I don’t record the
Owner or Status transactions because I don’t want either to trigger any
other scrips (the Priority transaction will trigger the Resolved scrip).

Here’s what I use:
// Custom condition
{ ### True if e-mail contains ‘ok’ - sets owner, pri => 20
my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
my $Queue = $self->TicketObj->QueueObj;
my $val = $Transaction->Type eq ‘Correspond’
&& $Queue->IsAdminCc($CreatorId)
&& $Transaction->Content =~ /\bok\s/i;
return $val;

// Custom preparation code
return 1;

// Custom cleanup code

Set priority to 20 to show complete, status to ‘resolved’

my $Ticket = $self->TicketObj;
my $Transaction = $self->TransactionObj;
my $CreatorId = $Transaction->CreatorObj->Id;
my $NewPri = 20;
$Ticket->_Set(Field=>‘Owner’, Value=>$CreatorId, RecordTransaction=>0);
$Ticket->SetPriority($NewPri);
$Ticket->_Set(Field => ‘Status’, Value => ‘resolved’, RecordTransaction
=> 0);

GeneOn 3/23/2010 8:11 PM, Jason Clarke wrote:

Hi list,

I’m looking for some guidance on setting up a scrip to provide a odd bit
of functionality.

  1. New email comes in.
  2. Auto assigned to queue.
  3. Auto-response goes to requester
  4. Auto-notification goes to watchers
  5. Watcher responds via email (thunderbird/outlook etc)
  6. RT pushes response to requester
  7. Custom Scrip sees that 5) came from a static list (or list of users
    in RT) and resolves the ticket.

Links to documentation or even a code sample would be greatly
appreciated. I’ve gone through wiki.bestpractical.com without much
success, but if there is “THE” page there, please link me :slight_smile: