Start a conversation

Kayako REST API Issues When Updating the Ticket Owner

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:

  1. Create a new ticket New Ticket -> Send an email


    Screenshot_2020-07-23_at_10.09.24_AM.png


  2. Leave the ticket unassigned 


    Screenshot_2020-07-23_at_10.35.24_AM.png


  3. Call Kayako API to update the ownerStaffId

    $ticket = kyTicket::get($ticketId);
    $ticket->setOwnerStaffId(1);
    $ticket->update();
  4. 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. 

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.



Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted
  3. Updated

Comments