Here is a query to return average ticket
close by category (which is set using freefield1). It should be relatively
easy to adapt this to your needs…
select ifnull(freetext1,'Unclassified'),
avg(TO_DAYS(t.change_time) - TO_DAYS(t.create_time))
from ticket t, ticket_state ts
where t.ticket_state_id = ts.id and
ts.id in (2,10) and
DATE_FORMAT(t.create_time,'%Y') = DATE_FORMAT(now(),'%Y')
group by freetext1;
I actually use this to feed a plot routine
for my system that returns the data in the form of a graph
For more comprehensive reporting (beyond a simple graph) we have
implemented more of an
Table bangalore_sla in database oc
Here is the relevant part of the script we run to refresh the
sladir='/home/oc_sla'
date=`date -I`
logfile=$sladir/refresh_oc_sla_$date.log
#
# Refresh
#
mysql -u $user -h $host -D otrs < $sladir/bangalore.sql >
$logfile
Hope it helps someone – have fun.
Mike
From:
otrs-bounces@otrs.org [mailto:otrs-bounces@otrs.org] On Behalf Of Davis, Gary H
Sent: Wednesday, January 04, 2006
12:29 PM
To: otrs@otrs.org
Subject: [otrs] Calculating avg.
ticket open time by queue
Is
there a way to calculate the average time between states in OTRS? For
example: we would like to know the average time between "open"
and "closed successfully" for all tickets submitted to the
"development" queue.
Any
help would be appreciated….
Thanks
Gary
Davis
PSIC
Lab Manger