About Event "ArticleCreate" and "TicketCreate"

Hi everyone, I'm developing a functionality that alerts (send a notification) some users when a high priority ticket is created or moved into some queue. But i have this problem: I am triggering the function when the Event "TicketCreate" (or "MoveTicket") occurs, and if the ticket accomplish the rules in the database (priorityID and queueID) it sends the notifications to the configured recipients. When it occurs after a "MoveTicket" event, runs fine and sends the notification properly. But the problem is that OTRS uses the article table to create the notification (build the subject and the body), and the creation of the article row to the new ticket (in the database) occurs after the action triggered by "TicketCreate". In other words, 1.- A ticket is created and TicketCreate triggers my Event response. 2.- My function tries to look into the article table with the given TicketID (but there is still no article row for that TicketID) to build the subject and body of the notification. 3.- My function sends an incomplete notification (with no subject and no body). 4.- After my event response function completes its job, the article row to that TicketID is created in the database (thats why it works fine with "MoveTicket" event, it finds an article row to the given TicketID). I am thinking in trigger my function after "ArticleCreate" instead of "TicketCreate", but now the problem is ¿how i know that an article was created because of a ticket was created before? Hope to be clear :-) Thanks, Eduardo Raffoul

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi,
I am thinking in trigger my function after "ArticleCreate" instead of "TicketCreate", but now the problem is ¿how i know that an article was created because of a ticket was created before?
...that should be the case when there's only one article in the ticket. regards, Torsten Thau - -- Torsten Thau, Dipl. Inform. c.a.p.e. IT Labs GbR - Annaberger Str. 240 - D-09125 Chemnitz phone: +49 371 5347 623 cell: +49 176 66 680 680 personal pgp-key: 0x93E0A174 fax: +49 371 5347 625 http://www.cape-it.de -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHTX9MvXo8m5PgoXQRAs87AJ49G9FUCC70gxjukZM372Emoprv7QCfXy9I wN5/Y8VWUsXmQLRRletlJ8I= =O8ke -----END PGP SIGNATURE-----
participants (2)
-
Eduardo Raffoul
-
Torsten Thau