The forum you are viewing relates to Kayako Classic. If you signed up or upgraded to the new Kayako (after the 4th July 2016), the information in this thread may not apply to you. You can visit the forums for the new Kayako here.

ticket time spen in each department

Hope to find a solution , i need to provide a report showing the average time the ticket takes in each department before resolving or assigned to another department ,

let me give you one scenario , customer complains from total disconnection , the help desk registrar the ticket then assign an owner (agent) to that ticket (need to get the time average time spent from registration till assigning ) , the agent even will solve the ticket or dispatch it to another department(need the time spent for him to receive and to solve or dispatch to another department) , in my helpdesk currently we only have two departments , the dispatched department even would solve the case or return it to that agent with no problem their side (need the time from receiving or returning the case ) ,
the returned ticket is only closed by the agent (as the link would be tested again to make sure everything is ok ) ,

I was referring to trying to get the time difference between changes in department. That is possible using direct MySQL ( the query needs a nested query to work ) But it wont be possible within the KQL system

The reason its not working is your calling timediff and passing it 'Ticket Audit Logs.Message', that does not contain the information needed by timediff. It needs to be comparing 'Ticket Audit Logs.Creation Date'. To do it properly too, you need to run the comparison of time row on row, as its changed status, and then sum up for each department. To run the row on row comparison requires using a nested select within the main select, and that's something KQL does not support atm.