[rt-users] Using RT::Template with MIMEObj to create a new ticket using ->Create()

Landon Stewart lstewart at iweb.com
Fri Sep 13 13:16:50 EDT 2013

This was originally posted to the RTIR list but I'm x-posting it here
because it's not specific to RTIR and I'm still having difficulties.

I've been unable to figure out how to call an action module from another
action module but instead I've been working on an action module that
- gets called on an Incident (and uses the create and correspond
transactions to open a new Investigations ticket)
- attaches the Incident Reports linked to that Incident to the

I have it creating a ticket although I haven't filled in much of the
CustomFields I'll need to I cannot get it to use a template for some

Specifically the LoadQueueTemplate() and Parse() a bit of a mystery to me.

    $templateObj->LoadQueueTemplate( Queue => "Investigations", Name =>
$classification." (en)" );
    my($ret, $msg) = $templateObj->Parse( TicketObj => $new_ticket,
TransactionObj => $self->TransactionObj );

I am building a MIME::Entity above this called $MIMEObj including all the
attachments etc but I don't understand how to get Parse() to to "do
something" to the MIMEObj to get the MIME::Entity->build( Data => … ) to
use the template.  Also the attachments are coming out in-line in the
message instead of attachments but that's probably because the
"RT-Attach-Message: yes" header is in the template that's not being used if
I'm understanding the use of that header correctly.

A more full representation of the code is here:

Thanks to anyone who has an idea of what I'm missing or doing wrong here
and might have some ideas for me.

Landon Stewart :: lstewart at iweb.com
Lead Specialist, Abuse and Security Management
Spécialiste principal, gestion des abus et sécurité
http://iweb.com :: +1 (888) 909-4932
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20130913/843250a2/attachment.html>

More information about the rt-users mailing list