OTRS/Znuny 7 通过 REST-API 创建工单后通知

huangapple go评论53阅读模式
英文:

OTRS/Znuny 7 notification after creating ticket via REST-API

问题

I'm using the OTRS REST API to create tickets in OTRS/Znuny 7. The ticket creation process is successful, but the subscribers of the respective queue do not receive any notification about the new ticket.

Interestingly, when I create a ticket via email, the subscribers do receive a notification. I have also made sure that the "NoAgentNotify" field is set to 0.

My question is: Are there any other fields or settings that need to be configured in order to trigger a notification for the queue subscribers when a ticket is created via the REST API?

请求主体

{
	"Ticket":
	{
		"Lorem ipsum",
		"QueueID": 35,
		"StateID": "new",
		"Lock": "unlock",
		"Priority": "3 normal"
	},
	"Article":
	{
		"CommunicationChannel": "Email",
		"From": "foo@bar.baz",
		"Subject": "Lorem ipsum",
		"Body": "Lorem ipsum dolor sit amet",
		"ContentType": "text/plain; charset=utf-8",
		"NoAgentNotify": 0
	}
}
英文:

I'm using the OTRS REST API to create tickets in OTRS/Znuny 7. The ticket creation process is successful, but the subscribers of the respective queue do not receive any notification about the new ticket.

Interestingly, when I create a ticket via email, the subscribers do receive a notification. I have also made sure that the "NoAgentNotify" field is set to 0.

My question is: Are there any other fields or settings that need to be configured in order to trigger a notification for the queue subscribers when a ticket is created via the REST API?

Request body

{
	"Ticket":
	{
		"Lorem ipsum",
		"QueueID": 35,
		"StateID": "new",
		"Lock": "unlock",
		"Priority": "3 normal"
	},
	"Article":
	{
		"CommunicationChannel": "Email",
		"From": "foo@bar.baz",
		"Subject": "Lorem ipsum",
		"Body": "Lorem ipsum dolor sit amet",
		"ContentType": "text/plain; charset=utf-8",
		"NoAgentNotify": 0
	}
}

答案1

得分: 0

触发"NewTicket-Notification",您必须向文章添加特定的"HistoryType"。

{
    "UserLogin": "root@localhost",
    "Password": "root",
    "Ticket": {
        "Queue": "Raw",
        "Title": "Test Ticket",
        "State": "new",
        "Priority": "3 normal",
        "CustomerUser": "customer-1"
    },
    "Article": {
        "CommunicationChannel": "Email",
        "From": "Znuny System <znuny@localhost>",
        "Subject": "Lorem ipsum",
        "Body": "Lorem ipsum dolor sit amet",
        "HistoryType": "EmailAgent",
        "ContentType": "text/plain; charset=utf-8"
    },
    "Attachment":     
}

"HistoryType" 必须匹配此代码片段中的正则表达式,用于控制特定通知 (EmailAgent, EmailCustomer, PhoneCallCustomer, WebRequestCustomer, SystemRequest)。

if (
        $FirstArticle &&
        $Param{HistoryType}
        =~ /^(EmailAgent|EmailCustomer|PhoneCallCustomer|WebRequestCustomer|SystemRequest)$/i
    )

如果您希望将此文章作为电子邮件发送,还必须添加"ArticleSend": 1,

英文:

To trigger the NewTicket-Notification you must add a specific HistoryType to the article.

{
    &quot;UserLogin&quot;:&quot;root@localhost&quot;,
    &quot;Password&quot;:&quot;root&quot;,
    &quot;Ticket&quot;:{
       &quot;Queue&quot;:&quot;Raw&quot;,
       &quot;Title&quot;:&quot;Test Ticket&quot;,
       &quot;State&quot;:&quot;new&quot;,
       &quot;Priority&quot;:&quot;3 normal&quot;,
       &quot;CustomerUser&quot;:&quot;customer-1&quot;
    },
    &quot;Article&quot;:{
        &quot;CommunicationChannel&quot;: &quot;Email&quot;,
        &quot;From&quot;: &quot;Znuny System &lt;znuny@localhost&gt;&quot;,
        &quot;Subject&quot;: &quot;Lorem ipsum&quot;,
        &quot;Body&quot;: &quot;Lorem ipsum dolor sit amet&quot;,
        &quot;HistoryType&quot;: &quot;EmailAgent&quot;,
        &quot;ContentType&quot;: &quot;text/plain; charset=utf-8&quot;
    },
    &quot;Attachment&quot; :     
}

The HistoryType musst match the RegEx in this snippet that controls this specific notification (EmailAgent, EmailCustomer, PhoneCallCustomer, WebRequestCustomer, SystemRequest).

if (
        $FirstArticle &amp;&amp;
        $Param{HistoryType}
        =~ /^(EmailAgent|EmailCustomer|PhoneCallCustomer|WebRequestCustomer|SystemRequest)$/i
    )
{

You must also add &quot;ArticleSend&quot;: 1, to send this article as an email if that is what you want to do.

huangapple
  • 本文由 发表于 2023年4月6日 20:44:27
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949683.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定