Change ticket time from customer view

Moderator: crythias

Locked
cbravo
Znuny advanced
Posts: 113
Joined: 18 Nov 2010, 00:33
Znuny Version: 3.0

Change ticket time from customer view

Post by cbravo »

Hello guys, I noticed that when a user is looking through his tickets he sees the time in minutes since the moment he opened the ticket. Is there any way to change that to show the time it took the ticket to be closed? or at least add a column to show the time it took for an agent to respond and close the ticket. Thank you.
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
vaishali_dolas
Znuny newbie
Posts: 17
Joined: 13 Sep 2010, 13:03
Znuny Version: 2.4.7
Location: India,Pune

Re: Change ticket time from customer view

Post by vaishali_dolas »

Im also looking for similar kind of solution..
Please any body has implemented something like this please let us know.

In this setup the time keeps on ticking even after i have set a ticket to "closed successful" or "closed unsuccessful". They way i want it is that the time really stops when a ticket gets set in one of does status.

I go link http://www.mail-archive.com/otrs@otrs.org/msg09655.html
which will give some idea of stop age of ticket after ticket state change to close successful.

Any kind of feedback is appreciated.
vaishali_dolas
Znuny newbie
Posts: 17
Joined: 13 Sep 2010, 13:03
Znuny Version: 2.4.7
Location: India,Pune

Re: Change ticket time from customer view

Post by vaishali_dolas »

I got query something like this
The ticket age is always calculated as time gap from ticket creation to
your actual system time.
This is reasonable because tickets could be reopened, so the time
between creation and closure can changes after reopening.

You can receive the time gap you require through SQL-queries on the
ticket-history-table by investigating the state-change-history-entries.

Here, you see a query that returns all successive state-changes. You can
take it as base for your needed modifications.
& it working perfectly fine. :)

Code: Select all

SELECT 
  (SELECT tn FROM ticket WHERE id = th.ticket_id) AS Ticket, 
  SUBSTRING_INDEX(TRIM(BOTH '%%' FROM th.name), '%%', 1) AS state1, 
  SUBSTRING_INDEX(TRIM(BOTH '%%' FROM th.name), '%%', -1) AS state2, 
  paare.time1 AS time1, th.create_time AS time2, 
  (UNIX_TIMESTAMP(th.create_time)-UNIX_TIMESTAMP(paare.time1))/3600 AS 
diffhour 
FROM 
( /* History-Paare der aufeinanderfolgenden Statusaenderungen */ 
  SELECT 
  th.id AS id1, 
  th.create_time AS time1, 
  (SELECT MIN(id) FROM ticket_history WHERE ticket_id = th.ticket_id AND 
history_type_id = 27 AND id > th.id) AS id2 
FROM ticket_history th 
WHERE th.history_type_id = 27 OR th.history_type_id = 1/* nur neue 
Tickets oder State-Updates */ 
) AS paare 
INNER JOIN ticket_history th 
ON paare.id2 = th.id 
ORDER BY th.ticket_id, paare.id2; 
Please check out this at your end & let me know in case of issue.
cbravo
Znuny advanced
Posts: 113
Joined: 18 Nov 2010, 00:33
Znuny Version: 3.0

Re: Change ticket time from customer view

Post by cbravo »

from what I've seen that link you posted is too old though. The files from version 3.0x have been modified too much to match that solution. Anyone has any idea of how to do this?
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5
Locked