[SOLVED] How to get history by SQL with ticket id key

Moderator: crythias

Post Reply
ibu58
Znuny newbie
Posts: 5
Joined: 12 Apr 2019, 03:40
Znuny Version: 5.0.x
Real Name: takahashi.ibu
Company: sni

[SOLVED] How to get history by SQL with ticket id key

Post by ibu58 »

I am a beginner of OTRS.
And English is not my native language. Please forgive me for typing errors.
I have a question about the use of OTRS.
It might be a FAQ but I could not find a way.

I want to get history by SQL with ticket id as key but can not generate "h.name" correctly.
Do you need something to do?

Below is the SQL I wrote.

Code: Select all

SELECT
    ht.name 'action',
    h.name, --  ※
    CONCAT (u.first_name, '', u.last_name) 'user',
    h.create_time
FROM
    ticket_history h
        INNER JOIN
    ticket_history_type ht ON history_type_id = ht.id
        INNER JOIN
    users u ON h.change_by = u.id
WHERE
    h.ticket_id = '9999';
Thank you for your consideration in advance.
OTRS 5.0.x (Testing) on CentOS 6.8 with a MySQL Ver 14.14 Distrib 5.1.73 database.
Post Reply