ticket number in stats object TicketAccountedTime

Moderator: crythias

Locked
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

ticket number in stats object TicketAccountedTime

Post by rvaldomir »

Hi,

Does anyone knows how to pull the Ticket#, accounted time just for the last month or defined period?

I don't want to use SQL at least I can define a SQL and execute it from the stats module.

As I could see the ticketlist object returns the Ticket# and Accounted time but I couldn't find a way to filter just worked time during a period.

any help?
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: ticket number in stats object TicketAccountedTime

Post by crythias »

rvaldomir wrote:I don't want to use SQL
That's ... unfortunate because
viewtopic.php?f=60&t=12546
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
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: ticket number in stats object TicketAccountedTime

Post by rvaldomir »

hi crythias,

Yes I already seen that post and we are using it as a WA but we want to provide a way to run the report from the stats module. Think about a role that only report time to a customer and they don't know about SQL :P
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: ticket number in stats object TicketAccountedTime

Post by rvaldomir »

crythias,

do you know how to use static stats?

I don't have the option to select an existing report in stats... probably If i can run it from the stats module in the website I can integrate the sql query there.

I have the default stat

Code: Select all


/opt/otrs/Kernel/System/Stats/Static
You have new mail in /var/spool/mail/otrs
[otrs@672940-usotrs01 Static]$ ls -lr
total 8
-rw-rw---- 1 otrs apache 5174 Jun 18  2014 StateAction.pm
[otrs@672940-usotrs01 Static]$

​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: ticket number in stats object TicketAccountedTime

Post by rvaldomir »

any help about how to integrate a query using the static stats template?
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
alexus
Znuny wizard
Posts: 383
Joined: 20 Sep 2010, 16:54
Znuny Version: OTRS 6 CE
Real Name: Alexey Yusov
Company: Radiant System Group s.r.o
Location: Prague
Contact:

Re: ticket number in stats object TicketAccountedTime

Post by alexus »

You need to develop custom module - static report with getting data via SQL-requests.
Alexey Yusov

Production: OTRS CE ITSM 6.0.28 on CentOS 7 + Apache 2.4 + MariaDB 10.4.13 + Radiant Customer Portal

Radiant System OTRS Intergrator
RS4OTRS marketplace
Stay tuned on our Facebook
((OTRS)) Community Edition - what next?
rvaldomir
Znuny expert
Posts: 155
Joined: 04 Aug 2014, 23:59
Znuny Version: 3.3.8
Real Name: Roberto A. Valdomir

Re: ticket number in stats object TicketAccountedTime

Post by rvaldomir »

Yes. But how to do it? Any help or template to execute the sql from that kind of modules?
​Roberto A. Valdomir
Mobile: (+598) 93 868 147 | Skype: roberto.a.valdomir
@roberto.valdomir | re.vu/robertovaldomir

----------------------------------------------------------------------------------------
OTRS 3.3.8 | RHEL 6 x64 | Oracle 11g | Custom Development by OTRS365
alexus
Znuny wizard
Posts: 383
Joined: 20 Sep 2010, 16:54
Znuny Version: OTRS 6 CE
Real Name: Alexey Yusov
Company: Radiant System Group s.r.o
Location: Prague
Contact:

Re: ticket number in stats object TicketAccountedTime

Post by alexus »

You can see it in /opt/otrs/Kernel/System/Stats/Static/StateAction.pm

Code: Select all

sub _GetHistoryTypes {
    my $Self = shift;

    my $SQL = 'SELECT id, name FROM ticket_history_type WHERE valid_id = 1';
    $Self->{DBSlaveObject}->Prepare( SQL => $SQL );

    my %Stats;
    while ( my @Row = $Self->{DBSlaveObject}->FetchrowArray() ) {
        $Stats{ $Row[0] } = $Row[1];
    }

    return %Stats;
}
Alexey Yusov

Production: OTRS CE ITSM 6.0.28 on CentOS 7 + Apache 2.4 + MariaDB 10.4.13 + Radiant Customer Portal

Radiant System OTRS Intergrator
RS4OTRS marketplace
Stay tuned on our Facebook
((OTRS)) Community Edition - what next?
Locked