Usage of ticket_history and ticket_history_type

Hi all, Having looked at the table definition of ticket_history and the table contents of ticket_history_type I made a couple of assumptions (I know, you should never just assume). As ticket_history contains the field system_queue_id and ticket_history_type contains values for "Close successful" and "Close unsuccessful" I assumed I would be able to find out when a ticket is closed in what queue. I needed this mechanism in order to be able to find out what time is spent on a ticket in what queue. When time is accounted for in one particular queue I know that I may charge this time to the customer. Other queues are used by different departments internally and they also do time accounting so I want to be able to see how much time is spent on a ticket by the different departments that I may not charge to the customer. When I started to build the select statements for this I went through the different tables and to my amazement, I found out that the history types I mentioned abover are never used at all! Luckily I can still use the type "AddNote" and check for the value "Close note added" in the history name field. However, I also found out that the system_queue_id field is never used (it is empty) which renders my idea useless of being able to split out the time accounting. I went through the code and was not able to find when of where these are used/written (but that could be my fault of course). Does anyone know whether this is a configuration issue or that I am just missing something or, even worse, got myself completely on the wrong track? Thanks in advance. Kind regards, Tom Hesp

Hi Tom, On Fri, Apr 02, 2004 at 05:42:09PM +0200, Tom Hesp wrote:
Does anyone know whether this is a configuration issue or that I am just missing something or, even worse, got myself completely on the wrong track?
Yes, system_queue_id is not used. You need to use history_type StateUpdate, Move and name of table ticket_history. So you can find you what you want (if I understood it correctly).
Kind regards, Tom Hesp
Martin Edenhofer -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Manage your communication!

Hi Martin, Thanks, I will have a look at that. Regards, Tom Hesp <> wrote on :
Hi Tom,
On Fri, Apr 02, 2004 at 05:42:09PM +0200, Tom Hesp wrote:
Does anyone know whether this is a configuration issue or that I am just missing something or, even worse, got myself completely on the wrong track?
Yes, system_queue_id is not used.
You need to use history_type StateUpdate, Move and name of table ticket_history.
So you can find you what you want (if I understood it correctly).
Kind regards, Tom Hesp
Martin Edenhofer

Hi Martin, I had a look at your suggestions and, although I think it might be possible to do it this way, I am afraid that this would cause quite a lot of work and it may be rather error-prone. I would need to write code to find out the times that a ticket is moved between queues, when the state changes and then, using these timestamps, find out when time_accounting was updated with what value. As tickets may in certain cases be moved back and forward between queues I stand a chance that I might miss time_accounting values or, even worse, count them double. I had a look at Kernel::System::Ticket::History and IMHO it should not be to difficult to write the queue id to the table ticket_history whenever an entry is added, I can just find out the current queue ID using the ticket ID passed. The only problem is that when a ticket is moved to another queue the history record is written after the move and you do not know the previous queue anymore. I can easily live with that. My only question is: can you think of any reason for me not to do this? For instance, are you planning to drop this field in a future version or are you planning to do something different with it? Thanks in advance. Kind regards, Tom <> wrote on :
Hi Tom,
On Fri, Apr 02, 2004 at 05:42:09PM +0200, Tom Hesp wrote:
Does anyone know whether this is a configuration issue or that I am just missing something or, even worse, got myself completely on the wrong track?
Yes, system_queue_id is not used.
You need to use history_type StateUpdate, Move and name of table ticket_history.
So you can find you what you want (if I understood it correctly).
Kind regards, Tom Hesp
Martin Edenhofer

On Monday, April 05, 2004 2:02 PM
Tom Hesp
My only question is: can you think of any reason for me not to do this? For instance, are you planning to drop this field in a future version or are you planning to do something different with it?
Sorry, we're not thinking about this or similar. The information about the previous queue is recorded in the ticket's history, so repeating it would denormalize the db because of redundant data. Regards, Robert Kehl -- ((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg http://www.otrs.de/ :: Tel. +49 (0)6172 4832388
participants (3)
-
Martin Edenhofer
-
Robert Kehl
-
Tom Hesp