Advertisement
Guest User

Untitled

a guest
Aug 6th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. $url = ""; // URL for OTRS server
  2. $username = ""; // SOAP username set in sysconfig
  3. $password = "” // SOAP password set in sysconfig
  4. $title=$_POST["mobile"];
  5. $typeID=1;
  6. $queueID=$_POST["queue"]; //Get Queue value from HTML Form
  7. $priorityID=$_POST["periority"]; //Get Queue Periority from HTML Form
  8. $description=$_POST["description"]; //Get Body/Description value from HTML Form
  9. $ownerID=1; //Set Owner default value for new Ticket
  10. $email=$_POST["email"]; //Get Email value from HTML Form
  11. $ContentType='text/plain; charset=ISO-8859-15'; //Set Content Type default value value for new Ticket
  12. $CustomerID=$SystemID; // This is your system ID
  13. $client2 = new SoapClient( null, array( 'location' => $url, 'uri' => "Core", 'trace' => 1, 'login' => username,'password' => $password, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED ));
  14. // Create new ticket
  15. $TicketID2 = $client2->__soapCall( "Dispatch", array($username, $password, "TicketObject", "TicketCreate", "Title", $title, "TypeID", $typeID, "QueueID", $queueID, "LockID", 1, "PriorityID", $priorityID, "State", "new", "CustomerID", $CustomerID, "OwnerID", $ownerID, "UserID", 1,"CustomerUserID", $CustomerUserID, ) );
  16. // Create the first Article for the new created Ticket
  17. $ArticleID2 = $client2->__soapCall("Dispatch", array($username, $password, "TicketObject", "ArticleCreate", "TicketID", $TicketID2, "ArticleType", "webrequest", "SenderType", "customer", "HistoryType", "WebRequestCustomer", "HistoryComment", "created from PHP", "From", $email, "Subject", $title, "ContentType", "text/plain; charset=ISO-8859-1", "Body", $description, "UserID", 1, "Loop", 0, "AutoResponseType", 'auto reply', "OrigHeader", array( 'From' => $email, 'To' => $from, 'Subject' => $title, 'Body' => $description ), ) );
  18. //Display Article ID and Ticket ID
  19. echo " New Ticket ID: ".$TicketID2."<br>";
  20. $client3 = new SoapClient( null, array( 'location' => $url, 'uri' => "Core", 'trace' => 1, 'login' => username, 'password' => $password, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED ));
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement