I am a definitely a RT newbie but have managed to generate a number of
CGI forms that end up submitting an RT ticket into RT using the HTTP
POST method. Works great. However the only response I appear to get back
is the HTTP success status code. Nothing else.
I would love the POST operation to return back the RT number for the ticket
I have created. This would allow me to attach the RT ticket number to other
files, logs and SVN operations the CGI scripts mess with.
How do I get the HTTP POST to return information on the created ticket.
What URL are you posting to? Are you using the REST interface or the
normal web interface?
Hmm, not sure. I thought I was using the POST interface. As far as RT
is concerned is POST The same as REST?
my $ua = LWP::UserAgent->new;
$ua->credentials( $RThost, 'OUR Internal Request System', $RTusername, $RTpassword );
my $response = $ua->post(
"http://$RThost/SelfService/Create.html",
'Content_Type' => 'form-data',
'Content' => [
'id' => "new",
'Queue' => $RTqueue,
'Requestors-Value' => $ENV{"REMOTE_USER"},
'Cc-Value' => join( ",", @recipients ),
'Subject' => $RTsubject,
'ContentType' => "text/plain;charset='utf-8'",
'Content' => join( "", @message ),
'ArmPriority' => "ST",
'ArmPriorityDue' => "",
'ArmPSJustify' => "",
'FCKeditorEncoded' => "1",
'Object-RT::Ticket--CustomField-101-Values-Magic' => "1",
'Object-RT::Ticket--CustomField-101-Values' => "Normal",
'Object-RT::Ticket--CustomField-102-Values-Magic' => "1",
'Object-RT::Ticket--CustomField-102-Values' => "DocSupport",
'Attach' => [
undef,
'',
'Content-Type' => "application/octet-stream",
'Content' => "",
],
]
);
– IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.