[rt-users] Getting a HTTP POST to return info on the created ticket

Fergus McMenemie Fergus.McMenemie at arm.com
Tue Apr 17 10:22:40 EDT 2012



-----Original Message-----
From: rt-users-bounces at lists.bestpractical.com [mailto:rt-users-bounces at lists.bestpractical.com] On Behalf Of Thomas Sibley
Sent: 17 April 2012 15:07
To: rt-users at lists.bestpractical.com
Subject: Re: [rt-users] Getting a HTTP POST to return info on the created ticket

On 04/17/2012 09:16 AM, Fergus McMenemie wrote:
> 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.


More information about the rt-users mailing list