英文:
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.
{
"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" :
}
The HistoryType musst match the RegEx in this snippet that controls this specific notification (EmailAgent, EmailCustomer, PhoneCallCustomer, WebRequestCustomer, SystemRequest).
if (
$FirstArticle &&
$Param{HistoryType}
=~ /^(EmailAgent|EmailCustomer|PhoneCallCustomer|WebRequestCustomer|SystemRequest)$/i
)
{
You must also add "ArticleSend": 1,
to send this article as an email if that is what you want to do.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论