Creating a ticket whose content is "foo"

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

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@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

~JasonOn 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