Create ticket via API combine with mailbox

Hello!
We use Youtrack as a help desk system (version 2023.2.21228).
There is a project (helpdesk type) to which we add tickets through the mailbox and through a form on the website via the API.

Tickets and subsequent comments to them are created through the mailbox as written in the Youtrack description, everything is fine. When created via the API, the following happens:
1. a ticket is created via the API;
2. a comment from the support service is left on it and it is sent by mail to the address specified in the form when creating a ticket;
3. the user who created the ticket receives it in the mail, but when responding via mail to the received message in the system, it is not added as a comment to the existing ticket, but a new ticket is created;

I think the reason is that there is no entry in Processed Emails with a Message ID after sending the first response to the ticket, The Message IDs of only emails that created tickets are registered.

It is necessary that the user's first response via email to the support service's response to a user's ticket left via the API should be added as a comment to the existing ticket, rather than a new ticket being created.
Is there a solution to this problem?

0
3 comments

Hi! Replies to the ticket confirmation email are supposed to be reflected in the ticket that was created via the form, so the behavior that you describe is not expected. Please submit a private ticket for an investigation—we'll likely need to look into the logs and see the .eml file to check how the headers match with the configuration: https://jb.gg/ytsup

0

Stanislav Dubin  Hi there, I believe this is the same issue I am encountering in a support ticket I generated yesterday. I'll paste some details here for the community:

 

<snip>

when an Agent adds a comment to the ticket [that was created with the REST API specifying a Reporter other than the user linked to the API credentials], something weird happens. Instead of the reporter receiving an email saying something like 
[YouTrack, Commented] Issue BCS-137: THIS IS A TEST
the report receives an email entitled
[Ticket Updated] [error]

and of course replying back to that email doesn't link to the existing issue, rather it creates a new one. (I'm using the built in YT mail channel.)

I took a look at the reporter User's notification settings and everything seems to be okay.

</snip>

 

<snip>

One other thing I have noticed. I'll mention it in case it helps you think through the potential issues here.

 

When I create an issue via the Youtrack built in form service, I receive a [Request Received] email and any comments logged to the ticket generate an email with a proper subject line like [YouTrack, Commented] Issue XXX-YYY.

 

But, when I create an issue by POST Issues and specifying the reporter, the system does not create the [Request Received] email piece and comments added to the ticket generate the [Ticket Updated] [Error] email piece as described in my original post.

</snip>

 

Something about the email generation seems to be unable to pick up the right information so that the mail headers are generated properly to link mail replies back to the submitted ticket.

0

Hi Jake Sterling, I hope you won't mind if I repeat my points shared in another thread. The notification scheme implemented in helpdesk projects requires that the ticket is created via one of the supported channels: online form or email. There is no official REST API for creating tickets, although it's possible to do so by mimicking the request that the browser makes when the form is filled in (you can check the request in the Network tab of your browser's devtools). This endpoint might or might not change at some point in time as it's not a public API endpoint, but it could work as a workaround for the time being. With this approach, there shouldn't be issues with email notifications from YouTrack about public ticket replies.

0

Please sign in to leave a comment.