我目前在下面通过调用链接/otrs/nph-genericinterface.pl/Webservice/GenericTicketConnectorREST/Ticket
来更新OTRS票证效果很好,但是如果更新故障单怎么能让它向客户发送电子邮件呢?
var body = JSON.stringify ({
"Ticket":{
"StateID":params.state},
"Article":{
"ArticleTypeID":params.noteType,
"Subject":params.subject,
"Body":params.bodyText,
"ContentType":params.contentType
}
}
);
//Build the full URL for our webservice query.
var LoginURL = authenticate.URL + "/" +
TicketID +
"?UserLogin=" + authenticate.UserLogin +
"&Password=" + authenticate.Password;
//Perform the actual work. As well as the URL of the webservoce
var client = new apiclient.ApiClient({ serverid: this.serverid });
var resp = client.invoke( "formutils", "httpRequest", {
"url": LoginURL,
"method": "POST",
"headers": {
"ContentType":"application/json"},
"body": body
});
答案 0 :(得分:4)
如果您通过网络服务API更新故障单,默认情况下这不会触发向客户发送电子邮件,即使您将文章类型设置为“电子邮件外部”也是如此。
如果您确实希望这样做,最好的方法是创建一个新的通知(在OTRS 5之前,这将是一个'基于事件的通知'),如下所述:http://otrs.github.io/doc/manual/admin/stable/en/html/administration.html#adminarea-ticket-notifications
您可以匹配ArticleCreate事件,通过Web服务创建故障单的用户,也可以匹配其他属性。
https://github.com/OTRS/otrs/blob/6c87d2b1370b917629a99df7e080b8f87f051581/Kernel/GenericInterface/Operation/Ticket/TicketUpdate.pm#L1936调用内部API ArticleSend()
,它永远不会发送电子邮件而https://code.jquery.com/jquery-1.12.3.js
I tried to save the above link contents (i.e jquery-1.12.3.js) to my current directory.
But i got some interrupts while copy and paste it.
Steps which i followed:
会发送电子邮件。
有一个由Znuny发布的扩展程序,您可以在OTRS系统上安装该扩展程序,以便将此功能公开给Web服务:https://github.com/znuny/Znuny4OTRS-GIArticleSend