Very tricky double CreateTickets bug in RT3.0.12

Hello RT developers,

it seems that RT3 has trouble creating links for tickets when
“CreateTickets” Action is called twice.

E.g.

Ticket created in “Virus Report”
→ on Create, CreateTickets
Ticket created in queue “Infection”, Members = TOP
→ on Create, fill CustomField
→ on CustomField = XXX, CreateTickets
Ticket created in “Enforcement”, MemberOf = TOP

Now, whats happening is that the ticket in “Virus Report” is created,
causing a parent to be created in “Infection”, causing a child in
“Enforcement” when a certain condition is met.

If CustomField != XXX, this works and stops as expected.

Ticket 1 in “Virus Report”, Ticket 2 in “Infection”, 1 being child to 2.

If CustomField = XXX, the second CreateTickets script fails with ‘Can’t
call method “can” on an undefined value at
/opt/rt3/lib/RT/Action/CreateTickets.pm’

I have: Ticket 1 in “Virus Report”, Ticket 2 in “Infection”, Ticket 3 in
“Enforcement”, 3 being child to 2, but 1 NOT being child to 2.

Apparently, the creation of the “Members” link for ticket 2 is
postponed, but after the second “CreateTickets” run, the required
information is lost. Error occurs here:

    $RT::Logger->debug("Assigned $template_id with $id");
    $T::Tickets{$template_id}->SetOriginObj($self->TicketObj)

→ if $T::Tickets{$template_id}->can(‘SetOriginObj’);

Is there any fix/way around this?

Logs are attached, here is a relevant extract of the CreateTickets
templates:

for “Virus report” queue:

===Create-Ticket: Infection
Queue: Infections
Members: TOP
Content:
{$Tickets{‘TOP’}->Transactions->First->Message->First->Content}
ENDOFCONTENT

for “Infection” queue:

===Create-Ticket: Inform
{
use vars qw/$msg $user $admin/; # define global vars for this template

# $msg, $user, $admin are done

return '';

}Subject: {$Tickets{‘TOP’}->Subject}
Date: {$date}
Queue: Enforcements
MemberOf: TOP
{( $user ? "Requestor: ". $user : "Cc: ". $admin )}
Content:
{( $msg )}
ENDOFCONTENT

Best regards,

Ruediger Riediger

Dr. Ruediger Riediger Sun Microsystems GmbH
NSG - SunCERT Komturstr. 18a
mailto:Ruediger.Riediger@Sun.com D-12099 Berlin
NOTICE: This email message is for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
Any unauthorized review, use, disclosure or distribution is prohibited.
If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
PGP 2048RSA/0x2C5020E9 964C E189 0FF0 8882 2BAB 65E2 6912 1FF2

userlog (3.93 KB)