Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Request Tracker: Users

Getting a HTTP POST to return info on the created ticket

 

 

Request Tracker users RSS feed   Index | Next | Previous | View Threaded


Fergus.McMenemie at arm

Apr 17, 2012, 6:16 AM

Post #1 of 4 (240 views)
Permalink
Getting a HTTP POST to return info on the created ticket

Hi,

We are using RT 3.8.1

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.

Thanks in advance. Fergus.

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


trs at bestpractical

Apr 17, 2012, 7:06 AM

Post #2 of 4 (215 views)
Permalink
Re: Getting a HTTP POST to return info on the created ticket [In reply to]

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?


Fergus.McMenemie at arm

Apr 17, 2012, 7:22 AM

Post #3 of 4 (228 views)
Permalink
Re: Getting a HTTP POST to return info on the created ticket [In reply to]

-----Original Message-----
From: rt-users-bounces [at] lists [mailto:rt-users-bounces [at] lists] On Behalf Of Thomas Sibley
Sent: 17 April 2012 15:07
To: rt-users [at] lists
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.


trs at bestpractical

Apr 17, 2012, 11:35 AM

Post #4 of 4 (212 views)
Permalink
Re: Getting a HTTP POST to return info on the created ticket [In reply to]

On 04/17/2012 10:22 AM, Fergus McMenemie wrote:
> Hmm, not sure. I thought I was using the POST interface. As far as RT
> is concerned is POST The same as REST?

POST is a generic HTTP verb, not an interface. You're POSTing (making
an HTTP request) to the normal RT self service pages designed for end
users, not custom scripts.

You probably want to use the REST endpoints RT provides, otherwise you
get to parse the response headers or HTML for the ticket number and errors.

http://wiki.bestpractical.com/view/REST

> my $ua = LWP::UserAgent->new;
> $ua->credentials( $RThost, 'OUR Internal Request System', $RTusername, $RTpassword );
> my $response = $ua->post(
> "http://$RThost/SelfService/Create.html",
[snip]

Have you looked at $response->decoded_content? Read `perldoc
HTTP::Response` for what $response is.

Request Tracker users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.