Hi,
My configuration is:
osTicket Version v1.10.4 (035fd0a) — Up to date
Web Server Software Apache/2.4.6 (CentOS) PHP/5.4.16 mod_perl/2.0.10 Perl/v5.16.3
MySQL Version 5.5.60
PHP Version 5.4.16

In dashboard when i check my dashboard i found wrong field. At this time i've only 6 tickets opened and also closed.
But in dashboard i see 6 opened and 6 closed. And for each assignment i found a count in Assigned field.

If i open the database and check the ost_thread_entry table i found correctly only 6 entries

Looking in the class.report.php i found:
$res = db_query('SELECT state, DATE_FORMAT(timestamp, \'%Y-%m-%d\'), '
.'COUNT(DISTINCT T.id)'
.' FROM '.THREAD_EVENT_TABLE. ' E '
.' JOIN '.THREAD_TABLE. ' T
ON (T.id = E.thread_id AND T.object_type = "T") '
.' WHERE E.timestamp BETWEEN '.$start.' AND '.$stop
.' AND NOT annulled'
.' AND E.state IN ("created", "closed", "reopened", "assigned", "overdue", "transferred")'
.' GROUP BY E.state, DATE_FORMAT(E.timestamp, \'%Y-%m-%d\')'
.' ORDER BY 2, 1');

$stats = Ticket::objects()
->constrain(array(
'threadevents' => array(
'thread
eventsannulled' => 0,
'thread
eventstimestamprange' => array($start, $stop),
),
))
->aggregate(array(
'Opened' => SqlAggregate::COUNT(
SqlCase::N()
->when(new Q(array('threadeventsstate' => 'created')), 1)
),
'Assigned' => SqlAggregate::COUNT(
SqlCase::N()
->when(new Q(array('threadeventsstate' => 'assigned')), 1)
),
'Overdue' => SqlAggregate::COUNT(
SqlCase::N()
->when(new Q(array('threadeventsstate' => 'overdue')), 1)
),
'Closed' => SqlAggregate::COUNT(
SqlCase::N()
->when(new Q(array('threadeventsstate' => 'closed')), 1)
),
'Reopened' => SqlAggregate::COUNT(
SqlCase::N()
->when(new Q(array('threadeventsstate' => 'reopened')), 1)
),
));

So the tickets stats count how many times the words "created" "assigned" "closed" appear in ost_thread_event

In my ost_thread_event i've got this:

So how i could get real time stats, how could i know how many tickets are opened in this time ad how many every agent has assigned to?

Thank you

The Dashboard is really old and really tired. I gave up on it back in 1.7 and purchased the Reports plugin from @scottro. He sells it over at http://software-mods/ and it is reasonably price as a one time purchase.

Write a Reply...