Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $url = ""; // URL for OTRS server
- $username = ""; // SOAP username set in sysconfig
- $password = "” // SOAP password set in sysconfig
- $title=$_POST["mobile"];
- $typeID=1;
- $queueID=$_POST["queue"]; //Get Queue value from HTML Form
- $priorityID=$_POST["periority"]; //Get Queue Periority from HTML Form
- $description=$_POST["description"]; //Get Body/Description value from HTML Form
- $ownerID=1; //Set Owner default value for new Ticket
- $email=$_POST["email"]; //Get Email value from HTML Form
- $ContentType='text/plain; charset=ISO-8859-15'; //Set Content Type default value value for new Ticket
- $CustomerID=$SystemID; // This is your system ID
- $client2 = new SoapClient( null, array( 'location' => $url, 'uri' => "Core", 'trace' => 1, 'login' => username,'password' => $password, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED ));
- // Create new ticket
- $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, ) );
- // Create the first Article for the new created Ticket
- $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 ), ) );
- //Display Article ID and Ticket ID
- echo " New Ticket ID: ".$TicketID2."<br>";
- $client3 = new SoapClient( null, array( 'location' => $url, 'uri' => "Core", 'trace' => 1, 'login' => username, 'password' => $password, 'style' => SOAP_RPC, 'use' => SOAP_ENCODED ));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement