Help Desk Software & Beyond
August 21, 2017, 01:17:52 AM *
Welcome, Guest. Please login or register.
To post messages you need to register. We apologize for inconvenience, but this is to prevent spam.
Registration is instant (no email verification) and we do not ask for any personal information.

Login with username, password and session length
News: Welcome to Help Desk Software forum!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [REQ] automating submission of newticket?  (Read 7972 times)
TroubleTicketUser4499
Jr. Member
**

Karma: 5
Posts: 59


View Profile
« on: June 26, 2008, 03:30:22 PM »

I need some way of automating the submission of a newticket.  The scenario, I believe, is the user will click on a link, which will automatically send an email and create a new ticket.  This link will be placed in a non-perl system, which means I cannot pass session variables. The newticket page submits to the server via POST and is multipart/form-data.  The link would have to pass in parameters via querystring (GET) to the newticket page.  My question is would ttx have any problems with "made up" parameters in its URI?  I mean, does it check the entire querystring and only use what it needs?  Or, if it sees a parmeter that's unexpected, will it crap out?  What's a "made up" parameter?  Say I wanted to pass two parameters called emailaddy and nameofsender.  Will ttx complain? 

See, my idea, because I think it's the fastest way, is calling an onload event in javascript in the newticket page to examine the querystring.  If there are any values, I write them to the control components, clear the querystring to possibly avoid ttx crapping out, and submit the page, all in javascript.  Otherwise, the page will load as normal, indicating manual entry.  This should be feasible, no?
« Last Edit: June 26, 2008, 03:31:59 PM by sparky672 » Logged
Sparky
Moderator
Hero Member
*****

Karma: 85
Posts: 2,275


stop pushing all those buttons


View Profile
« Reply #1 on: June 26, 2008, 03:46:23 PM »

You can easily construct a link that will create a new ticket...

Follow some of these rules...

http://forum.unitedwebcoders.com/index.php/topic,64.msg1194.html#msg1194

Quote
/ttx.cgi?cmd=newticket&do=1&name=Joe%20Blow&email=Joe%40Blow.com&subject=this%20is%20my%20subject&problem=test%20message%20here

As long it contains cmd=newticket and do=1, you can specify any form input you wish within the URL query-string.

Remember to convert all spaces and invalid characters to proper URL encoding... i.e. - all spaces = %20

http://www.blooberry.com/indexdot/html/topics/urlencoding.htm


Quote
I mean, does it check the entire querystring and only use what it needs?  Or, if it sees a parmeter that's unexpected, will it crap out?  What's a "made up" parameter?  Say I wanted to pass two parameters called emailaddy and nameofsender.  Will ttx complain?

Just try it.   Wink

Quote
See, my idea, because I think it's the fastest way, is calling an onload event in javascript in the newticket page to examine the querystring.  If there are any values, I write them to the control components, clear the querystring to possibly avoid ttx crapping out, and submit the page, all in javascript.  Otherwise, the page will load as normal, indicating manual entry.  This should be feasible, no?

You can submit a URL with Javascript, so yes, that's feasible.
« Last Edit: June 26, 2008, 03:50:37 PM by sparky672 » Logged

Did you update the paths in ttxcfg.cgi after moving TTX to your new location?   Undecided
To those seeking help.... please report back when you figure it out.  Cheesy
TroubleTicketUser4499
Jr. Member
**

Karma: 5
Posts: 59


View Profile
« Reply #2 on: June 26, 2008, 08:15:01 PM »

Yea, it worked.  I haven't added code to ensure the URI is encoded and decoded properly yet but it's fine.  TTX doesn't complain.  Thank you.
Logged
lazna
Newbie
*

Karma: 0
Posts: 12


View Profile
« Reply #3 on: March 08, 2014, 05:33:22 AM »

I am try to create from cmdline new ticket (success) with file attached (failed), although if using standard new ticket form, attached file is delivered OK. Spend some time with wireshark and google, I have constructed such command:

c:\curl.exe --data "cmd=newticket&do=1&name=Joe%20Luky&email=Joe%40Blow.com&subject=this%20is%20my%20subject&problem=test%20message%20here" -H "Content-Type: application/octet-stream" --data-binary "@config.bin" "http://myhost.com/ttx.cgi"

but this does not work. What is wrong?

L.

BTW: By work with wireshark I notice that the packet sending data from browser (IE10) form to cgi script is marked as "malformed", is this important for me?

Expert Info (Error/Malformed): Malformed Packet (Exception occurred)
Message: Malformed Packet (Exception occurred)
Severity level: Error
Group: Malformed
Logged
lazna
Newbie
*

Karma: 0
Posts: 12


View Profile
« Reply #4 on: March 16, 2014, 06:50:26 AM »

Just figure it out, so if someone else need automatically create tickets with file attachments: (all in one line)

Code:
curl.exe -F "cmd=newticket" -F "do=1" -F "internal=1" -F "name=Joe" -F "email=Joe@Blow.com" -F "subject=this is my subject" -F "problem=text message" -F "name=f1" -F "f1=@C:\Users\Public\Music\Sample Music\filename.mp3" -F "fname1=filename.mp3" "%TTX_URL%"

Edited by Sparky:  Please always enclose code with code tags.
« Last Edit: June 04, 2014, 10:43:25 AM by Sparky » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC3 | SMF © 2001-2006, Lewis Media Valid XHTML 1.0! Valid CSS!
Page created in 0.019 seconds with 20 queries.