Overview
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.
Diagnosis
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);
$ticket->setOwnerStaffId(1);
$ticket->update(); - Validate the creator's email id, it will be updated by staff id.
Prerequisites
- 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.
Solution
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.
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:
$ticket->setOwnerStaffId("owneridhere");
$ticket->update();
3. Revert and update ticketReplyTo:
$sql = "UPDATE `swtickets` SET `replyto` = $replyto WHERE `ticketid`=$ticketid";
Confirmation
After applying the solution, the creator's email id will no longer be updated when changing the ticket owner.