Exclude tickets from Dashboard "statistics"

English! place to talk about development, programming and coding
Post Reply
pistobef
Znuny newbie
Posts: 20
Joined: 02 Sep 2010, 12:40
Znuny Version: 3.0.9
Location: Italia

Exclude tickets from Dashboard "statistics"

Post by pistobef »

Where I can find the query that populate stats graph in dasboard?
I'll excleude certain queue from it ad reuse the query in our BI apps thas we use to monitor the open/close situation.
You do not have the required permissions to view the files attached to this post.
OTRS 3.0 on Debian with MySQL database connected to Opnen LDAP for Agents and Customers.
Alexander Halle
Znuny expert
Posts: 296
Joined: 04 Jul 2010, 17:49
Znuny Version: 3.1.x
Real Name: Alexander Halle
Company: radprax MVZ GmbH
Location: Wuppertal
Contact:

Re: Exclude tickets from Dashboard "statistics"

Post by Alexander Halle »

otrs/Kernel/Output/HTML/DashboardTicketStatsGeneric.pm (Data)
otrs/Kernel/Output/HTML/Standard/AgentDashboardTicketStats.dtl (Layout)

Please consider to later publish your changes or part of them so that others can learn from it.

(For example I managed to change the colors and to disable one graph, but influencing the data query exceeds my current knowledge.)
Alexander Halle System: OTRS 3.1.x, Ubuntu 10.04.x LTS, MySQL 5.1.x, Apache 2.2.x
OTRS Community Links: User Meetings, Projects
pistobef
Znuny newbie
Posts: 20
Joined: 02 Sep 2010, 12:40
Znuny Version: 3.0.9
Location: Italia

Re: Exclude tickets from Dashboard "statistics"

Post by pistobef »

Alexander_Halle wrote:otrs/Kernel/Output/HTML/DashboardTicketStatsGeneric.pm (Data)
otrs/Kernel/Output/HTML/Standard/AgentDashboardTicketStats.dtl (Layout)

Please consider to later publish your changes or part of them so that others can learn from it.

(For example I managed to change the colors and to disable one graph, but influencing the data query exceeds my current knowledge.)
I diden't found notingh that help me to achive my goals. :(
OTRS 3.0 on Debian with MySQL database connected to Opnen LDAP for Agents and Customers.
Alexander Halle
Znuny expert
Posts: 296
Joined: 04 Jul 2010, 17:49
Znuny Version: 3.1.x
Real Name: Alexander Halle
Company: radprax MVZ GmbH
Location: Wuppertal
Contact:

Re: Exclude tickets from Dashboard "statistics"

Post by Alexander Halle »

pistobef wrote:I diden't found notingh that help me to achive my goals. :(
DashboardTicketStatsGeneric.pm (Version 1.18), line 114, the TicketSearch function, it seems there is the data collected.

The function parameters are explained on http://dev.otrs.org/ ---> Kernel::System::Ticket ---> TicketSearch() (at the middle of the page).

I think you will have to set the parameter "Result" to "ARRAY" instead of "COUNT". Sorry, I don't know Perl (yet).
Alexander Halle System: OTRS 3.1.x, Ubuntu 10.04.x LTS, MySQL 5.1.x, Apache 2.2.x
OTRS Community Links: User Meetings, Projects
Daniel Obee
Moderator
Posts: 644
Joined: 19 Jun 2007, 17:11
Znuny Version: various
Real Name: Daniel Obée
Location: Berlin

Re: Exclude tickets from Dashboard "statistics"

Post by Daniel Obee »

Alexander is right - you gotta change ther ticketsearch parameters. Unfortunately there's no option to exclude queues in the search. You'd have to include all queues that you wanna search.

One could though get all queues with

Code: Select all

my %Queues = $QueueObject->GetAllQueues();
and kick unwanted queues off.

Would be incredibly cool to make the whole thing configurable via admin interface by adding a config option "excluded queues".

Greets
Dan
pistobef
Znuny newbie
Posts: 20
Joined: 02 Sep 2010, 12:40
Znuny Version: 3.0.9
Location: Italia

Re: Exclude tickets from Dashboard "statistics"

Post by pistobef »

tisar wrote:Alexander is right - you gotta change ther ticketsearch parameters. Unfortunately there's no option to exclude queues in the search. You'd have to include all queues that you wanna search.

One could though get all queues with

Code: Select all

my %Queues = $QueueObject->GetAllQueues();
and kick unwanted queues off.

Would be incredibly cool to make the whole thing configurable via admin interface by adding a config option "excluded queues".

Greets
Dan

I've used QueueIDs => [x,y,z] (passing 65 qIds,) to filer filter the stats to set $CountCreated and $CountClosed variable in DashboardTicketStatsGeneric.pm module and now the graph are perfect in OTRS :-)

I also need to make the same graph in Qilk but im'not able to identify the # of ticket closed every day; wich is the table/coloumn wich contain this info.

manny tanks
Franco
OTRS 3.0 on Debian with MySQL database connected to Opnen LDAP for Agents and Customers.
Daniel Obee
Moderator
Posts: 644
Joined: 19 Jun 2007, 17:11
Znuny Version: various
Real Name: Daniel Obée
Location: Berlin

Re: Exclude tickets from Dashboard "statistics"

Post by Daniel Obee »

it's in the ticket_history. status change (history_id_type 27 if I remember correctly) and status in on of the closed states. Or you use the TicketSearch() object with:

Code: Select all

        # tickets with closed time after ... (ticket closed newer than this date) (optional)
        TicketCloseTimeNewerDate => '2006-01-09 00:00:01',
        # tickets with closed time before ... (ticket closed older than this date) (optional)
        TicketCloseTimeOlderDate => '2006-01-19 23:59:59',
Check http://dev.otrs.org/3.0/ for more info.

Greets
Dan
pistobef
Znuny newbie
Posts: 20
Joined: 02 Sep 2010, 12:40
Znuny Version: 3.0.9
Location: Italia

Re: Exclude tickets from Dashboard "statistics"

Post by pistobef »

i've also created the query to count :
* all open tk in the sytem in a specific day

Code: Select all

 SELECT  count(*) 
FROM `otrs3`.`ticket_history` 
where create_time >= '2011-04-06 00:00:00'   
and create_time <  '2011-04-07 0:00:00'   
and history_type_id = 1 
* all closed tk in the sytem in a specific day

Code: Select all

 SELECT  count(*) FROM `otrs3`.`ticket_history` 
where create_time >= '2011-04-06 00:00:00'   
and create_time <  '2011-04-07 0:00:00'    
and history_type_id = 27
and state_id in (
      SELECT id  
      from   `otrs3`.`ticket_state`
      where  type_id = 3 )  -- prendo le variazioni dei tk a stati di chiusura
OTRS 3.0 on Debian with MySQL database connected to Opnen LDAP for Agents and Customers.
Post Reply