Sometimes, while updating staff owner id of tickets via Kayako REST API, the creator's email id is also getting updated. This article provides information on how to fix this issue.
This issue is a known bug that was caused by the code where instead of updating the changed field it was updating all the fields.
The name of the user who created the ticket gets replaced by the staff owner and the user no longer receives updates for the ticket.
To replicate the issue follow the steps below:
- Create a new ticket New Ticket -> Send an email
- Leave the ticket unassigned
- Call Kayako API to update the ownerStaffId
$ticket = kyTicket::get($ticketId);
- Validate the creator's email id, it will be updated by staff id.
- Active product license and support subscription.
- To check the status of your license and subscription, log onto My Kayako and click on My Orders.
- Make sure you have admin privileges for not only your Kayako Classic Download instance but also the server you use to host it.
- Ensure that your server environment is up-to-date with Kayako Classic's requirements.
If you are still using an older version, i.e. anything below 4.93.11, you are most likely to encounter this issue. This issue was fixed in Kayako Classic 4.93.11 and higher versions. For resolution, you need to upgrade your helpdesk to the latest version available.
Kayako Classic Download: To upgrade to the latest version of Kayako Classic, please visit the Upgrading or Downgrading Your Kayako Classic Download Helpdesk article.
Kayako Classic OnDemand: Click the Submit a ticket button at the top of this page to request for an upgrade of your instance. We will upgrade it from the backend.
If the upgrade is not possible, below is a workaround for this bug.
1. Fetch and store ticketReplyTo to a variable:
$ticketreplyto = $kayakoDB->query("SELECT `replyto` FROM `swtickets` WHERE `ticketid` = $ticketid");
$ticketpostresult = $ticketreplyto->fetch_array();
$replyto = $ticketpostresult['replyto'];
2. Set owner staff id:
3. Revert and update ticketReplyTo:
$sql = "UPDATE `swtickets` SET `replyto` = $replyto WHERE `ticketid`=$ticketid";
After applying the solution, the creator's email id will no longer be updated when changing the ticket owner.