Discussion:
[otrs] Usage of ticket_history and ticket_history_type
Tom Hesp
2004-04-02 15:42:09 UTC
Permalink
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
Martin Edenhofer
2004-04-02 15:42:47 UTC
Permalink
Hi Tom,
Post by Tom Hesp
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).
Post by Tom Hesp
Kind regards,
Tom Hesp
Martin Edenhofer

--
((otrs.de)) :: OTRS GmbH :: Norsk-Data-Str. 1 :: 61352 Bad Homburg
http://www.otrs.de/ :: Manage your communication!
Tom Hesp
2004-04-02 19:25:15 UTC
Permalink
Hi Martin,

Thanks, I will have a look at that.

Regards,
Tom Hesp
Post by Martin Edenhofer
Hi Tom,
Post by Tom Hesp
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).
Post by Tom Hesp
Kind regards,
Tom Hesp
Martin Edenhofer
Tom Hesp
2004-04-05 12:02:23 UTC
Permalink
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
Post by Martin Edenhofer
Hi Tom,
Post by Tom Hesp
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).
Post by Tom Hesp
Kind regards,
Tom Hesp
Martin Edenhofer
Robert Kehl
2004-04-07 08:05:24 UTC
Permalink
On Monday, April 05, 2004 2:02 PM
Post by 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

Loading...