Infos:
Used Zammad version: Latest
Used Zammad installation type: Docker
Browser + version: Chrome
Expected behavior:
Create a ticket with the api but of type “email” and not of type “note”.
Actual behavior:
In spite of my numerous tests, the ticket is created in note type
Steps to reproduce the behavior:
Here is the code we use
title: title.value,
group: 'Users',
customer: props.email,
priority_id: selectedPriority.value,
type: selectedType.value,
associated_server: associatedServer.value,
article: {
subject: title.value,
body: body.value,
type_id: 1,
type : "email",
from: "Users",
to : "Support <support@test.com>",
cc : "",
content_type: "text/html",
internal: false,
attachments: attachments.value,
}
Have you tried to only use either type or type_id?
Yes! I have tested a lot of things
I compared it with the request executed on the zammad interface and it is similar
If it may help here’s the working code we’re using.
A part from creating a ticket as “web” instead of “email” it works just fine.
var POST_URL = "________";
var MY_TOKEN = "________"
function onSubmit(e) {
// get all item responses contained in a form response
var response = e.response.getItemResponses();
// get the email address of the person who submitted a response
// Since we've activated the "collect e-mail function" under settings of our form (required for this script to work)
var mail = allResponses[allResponses.length - 1].getRespondentEmail();
// Creating the ticket body
var ticketBody ="";
for (let i = 0; i < response.length; i++) {
// The following code is only needed if you have your users uploading files.
if (response[i].getItem().getType() == "FILE_UPLOAD")
{
var string = response[i].getResponse().toString();
var splitted = string.split(",");
for (let h = 0; h < splitted.length; h++)
This file has been truncated. show original
1 Like
In PHP, i use this to post the JSON-Data to instance_url/ticket_articles:
$postdata = array(
"ticket_id" => $tickeid,
"subject" => $articlesubject,
"body" => $body,
"content_type" => "text/html",
"type" => "email",
"internal" => false,
"sender" => "Agent",
"to" => $email,
);
Maybe, you are missing the “sender” field?
2 Likes
@Filippoc @richie_77 Thank you both.
I changed the type to web and added a sender and it works as I wanted (I wanted the customers to receive an email when they answer which is the case even with a web type)
1 Like
system
Closed
August 25, 2022, 1:14pm
7
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.