On empty databases (or no valid data) the dashboard reports 1's instead of 0's its a known issue.
I made the following changes in ajax.reports.php and the issue was resolved.
Right after # XXX: Die if $group not in $groups
I replaced $queries=array(
array(5, 'SELECT '.$info.',
COUNT(*)-COUNT(NULLIF(A1.state, "created")) AS Opened,
COUNT(*)-COUNT(NULLIF(A1.state, "assigned")) AS Assigned,
COUNT(*)-COUNT(NULLIF(A1.state, "overdue")) AS Overdue,
COUNT(*)-COUNT(NULLIF(A1.state, "closed")) AS Closed,
COUNT(*)-COUNT(NULLIF(A1.state, "reopened")) AS Reopened
FROM '.$info.' T1
LEFT JOIN '.TICKET_EVENT_TABLE.' A1
ON (A1.'.$info.'=T1.'.$info.'
AND NOT annulled
AND (A1.timestamp BETWEEN '.$start.' AND '.$stop.'))
LEFT JOIN '.STAFF_TABLE.' S1 ON (S1.staff_id=A1.staff_id)
WHERE '.$info.'
GROUP BY T1.'.$info.'
ORDER BY '.$info),
with this
$queries=array(
array(5, 'SELECT '.$info.',
SUM(CASE WHEN A1.state = "created" THEN 1 ELSE 0 END) AS Opened,
SUM(CASE WHEN A1.state = "assigned" THEN 1 ELSE 0 END) AS Assigned,
SUM(CASE WHEN A1.state = "overdue" THEN 1 ELSE 0 END) AS Overdue,
SUM(CASE WHEN A1.state = "closed" THEN 1 ELSE 0 END) AS Closed,
SUM(CASE WHEN A1.state = "reopened" THEN 1 ELSE 0 END) AS Reopened
FROM '.$info.' T1
LEFT JOIN '.TICKET_EVENT_TABLE.' A1 ON (A1.'.$info.'=T1.'.$info.' AND NOT annulled AND (A1.timestamp BETWEEN '.$start.' AND '.$stop.'))
LEFT JOIN '.STAFF_TABLE.' S1 ON (S1.staff_id=A1.staff_id)
WHERE '.$info.'
GROUP BY T1.'.$info.'
ORDER BY '.$info),
I have only 1 ticket in my db since we just started using it and it shows correctly under what department and helptopic we have some data the rest shows 0, if some1 can try it on bulk data we can confirm to have solved this issue.