MySQL query to select escalated tickets

Moderator: crythias

Locked
timurtamerlan
Znuny newbie
Posts: 1
Joined: 02 Jun 2011, 18:28
Znuny Version: 3.0.3

MySQL query to select escalated tickets

Post by timurtamerlan »

Dead OTRS gurus!

Please, help me to build mysql query to SELECT tickets that have been escalated. I did not find any flag like "isEscalated" in the "tickets" table.

I'm trying to build very custom weekly report to analyze the performance of the customer support service, that will show such figures as:

- Total number of tickets by service
- Number of escalates tickets by service
- Number of successfully closed tickets by service
- Number of tickets that are still open by service

If this is a bicycle and it has been invented already, I would be very grateful if you point at it -)
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: MySQL query to select escalated tickets

Post by crythias »

Do we need a seance to call up the zombie OTRS gurus? :)

Look in ticket for escalation_time escalation_update_time escalation_response_time escalation_solution_time

anything nonzero is a "hit"

These are int(11) and are therefore epoch time seconds.
example:

Code: Select all

SELECT FROM_UNIXTIME(escalation_update_time) FROM ticket WHERE escalation_time BETWEEN UNIX_TIMESTAMP('20110601') AND UNIX_TIMESTAMP('20110630');
http://dev.mysql.com/doc/refman/4.1/en/ ... -timestamp
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
kruegerM
Znuny expert
Posts: 213
Joined: 02 Dec 2010, 16:53
Znuny Version: 6.0.29
Real Name: Marc
Company: National Jewish Health
Location: Denver, CO

Re: MySQL query to select escalated tickets

Post by kruegerM »

just checking ...

for escalation_solution_time, is it

SELECT FROM_UNIXTIME(escalation_solution_time) FROM ticket WHERE escalation_time BETWEEN UNIX_TIMESTAMP('20110601') AND UNIX_TIMESTAMP('20110630');

or

SELECT FROM_UNIXTIME(escalation_solution_time) FROM ticket WHERE escalation_SOLUTION_time BETWEEN UNIX_TIMESTAMP('20110601') AND UNIX_TIMESTAMP('20110630');

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

Re: MySQL query to select escalated tickets

Post by crythias »

probably the latter.
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