Im trying to write a custom Ticket Event module, that is going to create a child ticket when some specific criteria is met; I have some way to the goal yet.
Thanks to a short tutorial here (viewtopic.php?f=60&t=10090&p=39314&hili ... ial#p39314) I managed to get started.
Right now im stuck when trying to access OldTicketData - that is the previous state of the ticket, as far as I can figure out it should be possible, since its done in the TriggerEscalationStopEvents.pm-module thats in the source code. But I cant manage to do it; fails on the first check if OldTicketData exists.
Any clues ?

for my $Needed (qw(TicketID OldTicketData)) {
if ( !$Param{Data}->{$Needed} ) {
$Self->{LogObject}->Log( Priority => 'error', Message => "Need $Needed in Data!" );
# return;
}
}
if ($Param{Event} eq 'TicketStateUpdate') {
# do some stuff
$Self->{LogObject}->Log( Message => $Param{Data}->{OldTicketData}->{State});
$Self->{LogObject}->Log( $Ticket{State});
$Self->{TicketObject}->HistoryAdd(
TicketID => $Param{TicketID},
CreateUserID => 1,
HistoryType => 'Misc',
Name => 'Ticket State Update',
);
};