First Response of each ticket.
Moderator: crythias
First Response of each ticket.
Is there any way to create an statistic that can let you get the first response of each ticket? I need the first response an agent made to each of our customers. I've been looking at the options, but can't find anything related to responses. If I have to create a query I don't mind, but I would very much appreciate if you guys could guide me.
Also, is there a database design or something like that? So that everytime I need something like this I could use it to guide myself.
Appreciate it very much.
Greetings,
Also, is there a database design or something like that? So that everytime I need something like this I could use it to guide myself.
Appreciate it very much.
Greetings,
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
OS: Ubuntu
Apache2/MySQL 5
Re: First Response of each ticket.
do you need the repsonse (not possible) or the response time?
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
"Testing": ((OTRS Community Edition)) and git Master
Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
Re: First Response of each ticket.
I need the response. I can't get it even by a query?
Greetings,
Greetings,
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
OS: Ubuntu
Apache2/MySQL 5
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: First Response of each ticket.
clear the limit in sqlbox and
SELECT id,name FROM article_type to see what makes sense for "response" to you. (email-external?) (note the id number)
SELECT id,name FROM article_sender_type (agent) (note the id number)
This is every email-external article relating to tickets created by a given agent.
SELECT a_from,a_to,a_cc,a_subject,a_body FROM article LEFT JOIN users ON users.id=article.create_by where article.article_type_id="(email-external id)" AND article.article_sender_type_id="(typeIsAgent id)" AND users.login="agentlogin" GROUP BY ticket_id
After this, you may want to read something like http://code.openark.org/blog/mysql/sql- ... -per-group
SELECT id,name FROM article_type to see what makes sense for "response" to you. (email-external?) (note the id number)
SELECT id,name FROM article_sender_type (agent) (note the id number)
This is every email-external article relating to tickets created by a given agent.
SELECT a_from,a_to,a_cc,a_subject,a_body FROM article LEFT JOIN users ON users.id=article.create_by where article.article_type_id="(email-external id)" AND article.article_sender_type_id="(typeIsAgent id)" AND users.login="agentlogin" GROUP BY ticket_id
After this, you may want to read something like http://code.openark.org/blog/mysql/sql- ... -per-group
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
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
-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: First Response of each ticket.
check your doc directory for OTRSDatabaseDiagram.png.cbravo wrote:is there a database design or something like that
http://source.otrs.org/viewvc.cgi/otrs/ ... iew=markup
the mwb is MySQL Workbench file which is incidentally a .zip file containing
prompt>unzip OTRSDatabaseDiagram.mwb
Archive: OTRSDatabaseDiagram.mwb
MySQL Workbench Model archive 1.0
inflating: document.mwb.xml
inflating: lock
inflating: @db/data.db
inflating: @scripts/1
lock, data.db, and the file named '1' are basically useless if you want to eyeball them for data structure, but the document.mwb.xml file contains the main connectivity information if you wanted to use something besides MySQL Workbench for observing data structure.
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
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
-
- Znuny advanced
- Posts: 121
- Joined: 30 Aug 2011, 10:48
- Znuny Version: 3.3.8 && 4.0.9
- Real Name: Artjoms Petrovs
- Location: Latvia
Re: First Response of each ticket.
Of course if the first response changes the state of the ticket from NEW to something else, then you can try to parse ticket_history table to get the first article which has state different from the state NEW, like:
it takes the first article of a ticket with different state than NEW and adds all the required info from other tables. I set this report as a Static Statistics module, so there are some more changeable parameters, like queue, create time, agentnames etc, but the core sql statement looks like this 
Code: Select all
SELECT ticket.tn, queue.name, CONCAT(users.first_name,' ',users.last_name), a.responsetime
from
(SELECT th1.ticket_id, MIN(th1.create_time) as responsetime
from ticket_history th1
WHERE th1.state_id NOT IN
(SELECT ticket_state.id from ticket_state where ticket_state.name = 'new')) as a
INNER JOIN ticket on ticket.id = a.ticket_id
INNER JOIN queue on ticket.queue_id = queue.id
INNER JOIN users on ticket.user_id = users.id
INNER JOIN ticket_type on ticket.type_id=ticket_type.id
where ticket.create_time>=? AND ticket.create_time<=?

Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
Re: First Response of each ticket.
Hello, this is exactly what I need, the Response Time that is. Is there a query already available? That would be awesome, thanks.jojo wrote:do you need the repsonse (not possible) or the response time?

-
- Moderator
- Posts: 10170
- Joined: 04 May 2010, 18:38
- Znuny Version: 5.0.x
- Location: SouthWest Florida, USA
- Contact:
Re: First Response of each ticket.
I tried ... viewtopic.php?f=53&t=19781#p77773
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
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
Re: First Response of each ticket.
Thanks Crythias