我试图通过PHP & OTRS的REST genericinterface创建一个Ticket (https:/doc.otrs.comdocmanualadmin6.0enhtmlgenericinterface.html#id-1.6.12.10.7.2。).
我可以创建一个 Ticket,也可以创建一个 Article。但是OTRS历史记录中没有发出邮件,而是看起来像用户在向队列中发送票据。而且也没有邮件发送给客户 :-(.但是我希望有一个外发的EMail Ticket和一个待处理的状态。
下面是我的PHP代码
<?php
header("Content-type: application/json; charset=utf-8");
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client;
$client = new Client(['base_uri' => 'http://test-otrs.company.local/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/']);
$arrTicket = array(
"Title" => 'some ticket title',
"Queue" => 'testqueue',
"Lock" => 'unlock',
"Type" => 'Unclassified',
"State" => 'new',
"Priority" => '3 normal',
"Owner" => 'username',
"CustomerUser" => '[email protected]'
);
$arrArticle = array(
"CommunicationChannel" => 'Email',
"SenderType" => 'agent',
"To" => '[email protected]',
"Subject" => 'some subject',
"Body" => 'some body',
"ContentType" => 'text/plain; charset=utf8'
);
$response = $client->post('Ticket', ['json' => array("UserLogin" => "username", "Password" => "testtesttest", "Ticket" => $arrTicket, "Article" => $arrArticle)]);
if ($response->getBody())
{
echo $response->getBody();
}
https:/forums.otterhub.orgviewtopic.php?p=168025#p168025。 解决了我的问题。你需要一个额外的插件(https:/github.comznunyZnuny4OTRS-GIArticleSend。)才能发送外发的EMail Ticket。