Statistics - Duration of a Ticket in one Queue

Moderator: crythias

Locked
pizzadood
Znuny newbie
Posts: 11
Joined: 17 Apr 2012, 03:51
Znuny Version: 3.1.3

Statistics - Duration of a Ticket in one Queue

Post by pizzadood »

Is there any way to calculate how long one ticket stays in one queue? Or more specifically, how long does one ticket remain without a response in one queue.
pizzadood
Znuny newbie
Posts: 11
Joined: 17 Apr 2012, 03:51
Znuny Version: 3.1.3

Re: Statistics - Duration of a Ticket in one Queue

Post by pizzadood »

Anyone?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Statistics - Duration of a Ticket in one Queue

Post by crythias »

pizzadood wrote:Is there any way to calculate how long one ticket stays in one queue
Unless it has moved, it's NOW() - create date.
pizzadood wrote:how long does one ticket remain without a response in one queue
Depends. Usually escalation (queue or sla) is involved with regard to this. Do you need a report on specific statistics, or do you need what escalation provides?
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
pizzadood
Znuny newbie
Posts: 11
Joined: 17 Apr 2012, 03:51
Znuny Version: 3.1.3

Re: Statistics - Duration of a Ticket in one Queue

Post by pizzadood »

Thank you for the response, Cryhtias. The report I'm trying to generate is independent from escalation, I think. To be more specific, I'm looking for a way to generate a report that shows how long tickets stay in one queue regardless if it was moved from another queue or if the ticket was originaly created there... I was thinking of creating an extra dynamic field that just records the time an article was created so it would show on the statistics page. Am I on the right track?
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Statistics - Duration of a Ticket in one Queue

Post by crythias »

I'd almost query that directly from ticket_history.

Here's a sample query to get you started:

Code: Select all

SELECT ticket.tn, ticket.title, ticket_history.name, ticket_history_type.name, ticket_history.create_time
FROM  `ticket` 
LEFT JOIN ticket_history ON ticket_history.ticket_id = ticket.id
LEFT JOIN ticket_history_type ON ticket_history.history_type_id = ticket_history_type.id
WHERE ticket_history_type.name =  "Move"
OR ticket_history_type.name =  "NewTicket"
OR (
ticket_history_type.name =  "StateUpdate"
AND (
ticket_history.name LIKE  '%closed successful\%\%'
OR ticket_history.name LIKE  '%closed unsuccessful\%\%'
)
)
ORDER BY ticket.tn
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
pizzadood
Znuny newbie
Posts: 11
Joined: 17 Apr 2012, 03:51
Znuny Version: 3.1.3

Re: Statistics - Duration of a Ticket in one Queue

Post by pizzadood »

Again, thank you Cryhtias for the sample query. Is there anyway to apply this to OTRS' statistics module? Or do I have to use an external reporting tool?
Locked