Trying to implement "On Resolve Forward Ticket"


Hi all!

I am currently trying to implement a “On Resolve Forward Ticket” scrip which should automatically doing the same as the “Forward” (Ticket-)Action in the Web-User-Interface. We need this for external documentation of the history of certain tickets.

After trying but failing with different possible solutions using custom perl code in scrips and templates I am currently back to start using the following (minimal) setup:


If I Resolve a Ticket now I get the following error in the Webserver/Apache error.log :

[16200] [Mon Sep 10 20:02:51 2018] [error]: Scrip Prepare 29 died. - Can’t call method “GetHeader” on an undefined value at /usr/share/request-tracker4/lib/RT/Action/ line 113.

[/usr/share/request-tracker4/html/autohandler:53] (/usr/share/request-tracker4/lib/RT/

RT version is RT 4.4.1-5 (Debian).

I also tried to kind of “re-engeneer” /ticket/Forward.html but could not find a solution for how to specify i.e. the TO: of the email to be generated.

Can anyone please help me with any examples or ideas on how to go on?

Thanks in advance and kind regards,


Good news, I finally found a working solution using custom commit code derived from Forward.html :slight_smile:

I will post as soon as I cleaned up the code.


SOLUTION: “Custom Action Commit Code” derived from Forward.html (NOTE: apply only with a proper Condition i.e. “On Resolve” - otherwise you may end up in an email-generation-loop because the code below itself generates a transaction which may trigger itself again and again) :

my $CustomSubject = $self->TicketObj->FirstCustomFieldValue(‘Order Type’) . " TEST - orig Subject: " . $self->TicketObj->Subject . " [" . ($self->TicketObj->QueueObj->SubjectTag || RT->Config->Get(‘rtname’)) . " #" . $self->TicketObj->id() . “]”;
my $CustomTo = ‘’;
my $CustomContent = ‘’;
my %ARGS = (
Transaction => undef,
Subject => $CustomSubject,
To => $CustomTo,
Cc => ‘’,
Bcc => ‘’,
Content => $CustomContent,
ContentType => ‘text/plain’,
my $TicketObj = $self->TicketObj;
Abort( loc(“Permission Denied”) )
unless $TicketObj->CurrentUserHasRight(‘ForwardMessage’);
my $txn;
$TicketObj->Forward( Transaction => $txn, %ARGS );
return 1;