[rt-users] Creating a ticket whose content is "foo"

Jason A. Smith smithj4 at bnl.gov
Wed Feb 9 09:11:49 EST 2011


Hi Wolfram,

I don't think you can use the Content arg in ticket creation, use 
MIMEObj instead, so first you would do:

my $MIMEObj = MIME::Entity->build(From    => "user at example.com",
                                   Subject => "Message subject",
                                   Type    => 'text/plain',
                                   Data    => "foo",
                                  );
# Convert text parts into utf-8 (taken from the email processing in RT):
RT::I18N::SetMIMEEntityToUTF8($MIMEObj);

Then replace the Content arg in the ticket create with:

MIMEObj => $MIMEObj

~Jason


On 02/09/2011 08:43 AM, Wolfram Huettermann wrote:
> Hello,
>
> I think this is a stupid question that I ask you old-timers in RT. I
> intend to create a ticket in the queue test and the content is "foo" in
> shell, not in MASON.
> Here is the code snippet:
>
>
> my $CurrentUser = GetCurrentUser();
> use RT::Tickets;
> my $Ticket = RT::Ticket->new($CurrentUser);
> my %TicketInput =
> (
> "Subject" => "The new ticket today",
> "Queue" => "testq-noc", # an existing one on your RT
> "Owner" => "root",
> "Requestor" => "max\@mustermann.de", # an existing one on your RT
> "Content" => "foo",
> "Status" => "new",
> );
>
> $Ticket->Create(%TicketInput);
>
> The ticket will be created, but its content remains empty if you look in
> the module Ticket/Display.html. Nevertheless, I want to create a ticket
> whose content is supposed to be "foo". I cannot use the function
> CreateTicket, as it only works on RT-MASON, but not on bash.
>
> Greetings,
>
> Wolfram Hüttermann
>




More information about the rt-users mailing list