I have a similar system where we are using osTicket to collect tickets from a few other platforms like WHMCS, and Kayako which is working great. However, when the customer respond to a ticket either in WHMCS/Kayako which is opened as a separate ticket in osTicket instead of thread on the actual initial one.
As per your description, the first two (message-id and reference-id) aren't possible match in this case, so I altered the subject line on the template "Response/Reply Template" to have "%{ticket.subject}" only so the subject line should match in this case. But even when the subject line matches, the responses on a ticket are opening as a separate ticket in osTicket. Not sure if there is anything we can alter to sort this out.
For example:
A ticket opened from WHMC has the subject "[Ticket ID: 609553] Ticket test" and this opened as a ticket in osTicket. When the customer give an update in this ticket on WHMCS, the osTicket fetch the response as a new ticket instead of thread into the existing one.
osTicket version: v1.14.1 (f1e9e88)
Is there anything we can do to sort it out? Any help would be much appreciated! 🙂