SetActiveOnCustomerReply

From Request Tracker Wiki
Jump to navigation Jump to search

Overview

The following is a scrip that will detect if a ticket is set to a certain status and change that status if someone other than the ticket owner replies. We use this with a custom ticket status called "customer".

Note: This was written for RT 4.2.13. It has not been tested on later versions at this time.

Scrip Details

Description: Set Active On Customer Reply

Condition: On Correspond

Action: User Defined

Template: Blank

Custom action preparation code

return 1;

Custom action commit code

# Pull transaction actor and ticket owner ID's and set variables
my $Actor = $self->TransactionObj->Creator;
my $Owner = $self->TicketObj->Owner;

# Get out if actor is ticket owner
if( $Owner != $Actor ) {
# Change status to "open" if status is "customer"
if ($self->TicketObj->Status() eq 'customer' ) {
$self->TicketObj->SetStatus('open');
$RT::Logger->info("Customer replied to ticket awaiting reply. Status set to open.");
return 1;
}
return undef;
}
return undef;