[rt-users] OnCreate insert a comment IN the ticket?

Thomas Sibley trs at bestpractical.com
Tue Sep 4 15:22:25 EDT 2012


On 09/04/2012 12:10 PM, Paul Tomblin wrote:
> On Tue, Sep 4, 2012 at 3:05 PM, Jeff Blaine <jblaine at kickflop.net> wrote:
>> my $ticket = $self->TicketObj;
>> $ticket->Comment(content => "blah!");
> 
>   my $mimeObj = MIME::Entity->build(
>     Type         => 'multipart/mixed',
>     'Message-Id' => RT::Interface::Email::GenMessageId,
>     Subject      => $subject,
>   );
>   $mimeObj->attach(
>     Type    => "text/plain",
>     Charset => 'UTF-8',
>     Data    => $summary
>   );
>   $mimeObj->make_singlepart;
>   $ticketObj->Comment(MIMEObj => $mimeObj);

While that works, it's unnecessary.  Jeff, the real problem is that you
spelled "Content" with a lowercase c.

If you were checking the return value of your call to ->Comment you'd be
told the call failed and a reason (no message provided).

    my ($ok, $msg) = $ticket->Comment(...);
    warn "Comment failed: $msg\n" unless $ok;




More information about the rt-users mailing list