Developer - Calculate time spent on ticket

Moderator: crythias

Locked
Thaenor
Znuny newbie
Posts: 4
Joined: 07 May 2015, 17:36
Znuny Version: 4.2.3.34
Real Name: Yuri Ine
Company: CodeMonkeys

Developer - Calculate time spent on ticket

Post by Thaenor »

I hope this is the right place to ask this, but I need help,

I want to elaborate an SQL statement or a php function that can calculate how much time a user has spent solving a certain ticket.
I wanted to know how can I do this? There is a timeout field on the tickets table (I have access to the DB) but I don't know what it means.
What is the best way to say "User X spent Y hours solving ticket W"?

Can someone please help?
Thanks in advance?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Developer - Calculate time spent on ticket

Post by crythias »

Unless an agent self reports his time, what would make sense to you? What *exactly* would count to indicate start and stop time by an agent on a ticket? Most of the time the agent submits after the session is complete, but what would indicate the start of session?

viewtopic.php?t=12546
Also, I use this:
http://sourceforge.net/projects/tinytimetracker/
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: Developer - Calculate time spent on ticket

Post by eandrex »

how much time a user has spent solving a certain ticket.
I wanted to know how can I do this?
Dont the stats do this already? Column header SolutionTimeInMin i think
or am i wrong
Thaenor
Znuny newbie
Posts: 4
Joined: 07 May 2015, 17:36
Znuny Version: 4.2.3.34
Real Name: Yuri Ine
Company: CodeMonkeys

Re: Developer - Calculate time spent on ticket

Post by Thaenor »

eandrex wrote:
how much time a user has spent solving a certain ticket.
I wanted to know how can I do this?
Dont the stats do this already? Column header SolutionTimeInMin i think
or am i wrong
And where can I find that column?
Thaenor
Znuny newbie
Posts: 4
Joined: 07 May 2015, 17:36
Znuny Version: 4.2.3.34
Real Name: Yuri Ine
Company: CodeMonkeys

Re: Developer - Calculate time spent on ticket

Post by Thaenor »

crythias wrote:Unless an agent self reports his time, what would make sense to you? What *exactly* would count to indicate start and stop time by an agent on a ticket? Most of the time the agent submits after the session is complete, but what would indicate the start of session?

viewtopic.php?t=12546
Also, I use this:
http://sourceforge.net/projects/tinytimetracker/
Those SQL queries are turning up errors on my DB. I'm using pgAdmin (postgres)
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Developer - Calculate time spent on ticket

Post by crythias »

Thaenor wrote:Dont the stats do this already? Column header SolutionTimeInMin i think
This accounts for the ticket's elapsed time from create to close. It doesn't necessarily represent
Thaenor wrote:how much time a user has spent solving a certain ticket.
Thaenor wrote:Those SQL queries are turning up errors on my DB. I'm using pgAdmin (postgres)
I'm not enough familiar with PGSQL to provide assistance in a timely manner on this.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
eandrex
Znuny expert
Posts: 213
Joined: 04 Nov 2012, 23:58
Znuny Version: OTRS 4.x
Real Name: Esteban
Company: NORTON DE COLOMBIA

Re: Developer - Calculate time spent on ticket

Post by eandrex »

Yeah, you are right, crythias.

The only problem querying "time_accounting" table, is that Agents can(and will) inflate their time.. so there is no real way to control it
EXG133
Znuny expert
Posts: 217
Joined: 06 Aug 2012, 18:12
Znuny Version: 3.1.7 & 4.04

Re: Developer - Calculate time spent on ticket

Post by EXG133 »

eandrex wrote:Yeah, you are right, crythias.

The only problem querying "time_accounting" table, is that Agents can(and will) inflate their time.. so there is no real way to control it
I had this same discussion but about HP OpenView & BMC Remedy instead of OTRS. Even with a fat client and more ways to check what agents are actually doing it all boils down to "but I have to trust the agent to report their time at some point". The only exception are highly integrated IP phone systems where agents only provide support over the phone. Even if your agents are completely honest it's so easy to forget to update a ticket or leave a popup open or make a typo or open the ticket of a colleague ... and I'm sure you can name more possibilities :)
Thaenor
Znuny newbie
Posts: 4
Joined: 07 May 2015, 17:36
Znuny Version: 4.2.3.34
Real Name: Yuri Ine
Company: CodeMonkeys

Re: Developer - Calculate time spent on ticket

Post by Thaenor »

Thanks for the feedback.

Is there any documentation I can read about how the OTRS tables are structured?
I wanted to see things like, how much time left before an sla is met or how do fields look like if that sla has been exceded.

Essencially I'm trying to figure out metrics in the system. What does the "timeout" collumn mean in tickets? Are those values unix timestamps? And what about "solution time" in "sla" table? They have an integer, but is it the time in hours? Minutes? Seconds?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Developer - Calculate time spent on ticket

Post by crythias »

https://github.com/OTRS/otrs/blob/rel-4 ... gresql.sql

If you see an integer used for time, that's epoch seconds.
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
Locked