crythias wrote:what is the submit method for your webform? (Don't tell me get/post. Tell me how you're intending to push the form to OTRS. Email?)
I am connecting to it via SOAP. I was using rpc.pl but I understand the Dynamic Fields in it are deprecated. I was trying to follow some instructions for adding it back in, and I can get a ticket submitted no problem, I can get it trying to use the Dynamic Field without giving me any error, however it just does nothing now. I know I am supposed to use the Generic Interface now and create a web service, my biggest issue with that, is simply that I cannot find all the proper information I need to create the web interface properly, and then the syntax to properly call it from my webform.
Here is the PHP code I am trying to work with:
<?php
if ($_POST != null){
echo "<br>";
echo "<br>";
$client = new SoapClient(null, array(
'location' => "
http://otrs.datamotion.com/otrs/rpc.pl",
'uri' => "Core",
'trace' => 1,
'login' => "xxxxxx",
'password' => "xxxxxx",
'style' => SOAP_RPC,
'use' => SOAP_ENCODED
));
$ticketnumber = $client->__soapCall("Dispatch", array("xxxxxx", "xxxxxxx", "TicketObject", "TicketCreateNumber"));
echo "Thank you for submitting a ticket, your Ticket Number is: ".$ticketnumber."<br>";
echo $_POST["company"];
$DynamicID = '10';
$CompName = 'Test Company';
echo $DynamicID;
$ticket = $client->__soapCall("Dispatch", array("xxxxxxx", "xxxxxxx", "TicketObject", "TicketCreate",
"TN" , $ticketnumber,
"Title" , $_POST["subject"],
"Queue" , 'Support',
"Lock" , 'unlock',
"Priority" , '3 normal',
"State" , 'new',
"Type" , 'default',
"Service" , '',
"SLA" , '',
"CustomerID" , $_POST["emailAddr"],
"CustomerUser" , $_POST["emailAddr"],
"OwnerID" , 1,
"ResponsibleID" , 1,
"UserID" , 1,
));
$article = $client->__soapCall("Dispatch", array("xxxxxx", "xxxxxx", "TicketObject", "ArticleCreate",
"TicketID" , $ticket,
"ArticleType" , 'email-external',
"SenderType" , 'customer',
"From" , $_POST["emailAddr"],
"To" , '
otrs@xxxxxxx.com',
"Cc" , '',
"ReplyTo" , '',
"Subject" , $_POST["subject"],
"Body" , $_POST["description"],
"MessageID" , '',
"ContentType" , 'text/plain; charset=utf-8',
"HistoryType" , 'OwnerUpdate',
"HistoryComment" , 'No History',
"UserID" , 1,
"NoAgentNotify" , 1,
"AutoResponseType" , 'auto reply',
"ForceNotificationToUserID" , 1,
"OrigHeader", array(
'From' => $_POST["emailAddr"],
'To' => '
otrs@xxxxxxx.com',
'Subject' => $_POST["subject"],
'Body' => $_POST["description"]
),
)
);
$companyname = $client->__soapCall("Dispatch", array("xxxxxx", "xxxxxx", "TicketDynamicObject", "ValueSet",
"FieldID" , "10",
"ObjectType", 'Ticket',
"ObjectID", $ticket,
"Value", array(
"ValueText", $_POST["company"]),
"UserID", 1,
));
}
?>