Store SQL statement as template report

Moderator: crythias

Post Reply
laylawan
Znuny newbie
Posts: 7
Joined: 06 Apr 2018, 11:24
Znuny Version: Version 6

Store SQL statement as template report

Post by laylawan »

Dear all,
I would like to extract the parent and child ticket in a report but found that there is no such template report in Statistics. So I have type my SQL statement to get the data that I needed. However, can I save this SQL statement as a template for report/ statistics? As I would like to let user to generate the report by themselves and no need to input the SQL.

Here is my SQL statement:
SELECT id as Ticket_ID, title, target_key as Child_ticket FROM
(select id, title from ticket) as ID
left join
(select source_key, target_key from link_relation) as SK
on ID.id = SK.source_key
order by ID ASC

Thanks & regards,
Layla
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Store SQL statement as template report

Post by zzz »

Hello Layla,

that is possible by creating a static statistic (Perl programming needed) in OTRS.
However, the documentation for statis statistics is very poor.

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
laylawan
Znuny newbie
Posts: 7
Joined: 06 Apr 2018, 11:24
Znuny Version: Version 6

Re: Store SQL statement as template report

Post by laylawan »

Dear Emin,

Thanks for your information. However, the static statistics in my OTRS is greyed out. I am using OTRS 6.
stat.jpg
How can I enable it?

Thanks & regards,
Layla
You do not have the required permissions to view the files attached to this post.
zzz
Znuny superhero
Posts: 888
Joined: 15 Dec 2016, 15:13
Znuny Version: All
Real Name: Emin
Company: Efflux GmbH
Contact:

Re: Store SQL statement as template report

Post by zzz »

Hello Layla,

you have to create a custom Perl module in Kernel/System/Stats/Static/

Example

Best regards
Emin
Professional OTRS, Znuny & OTOBO services: efflux.de | efflux.de/en/

Free and premium add-ons: German | English
laylawan
Znuny newbie
Posts: 7
Joined: 06 Apr 2018, 11:24
Znuny Version: Version 6

Re: Store SQL statement as template report

Post by laylawan »

Dear Emin,

Thanks for your reply. But it seems a little bit difficult. ><

Regards,
Layla
Post Reply