[rt-users] Conditionally prevent logging a ticket creation
Gene LeDuc
gleduc at mail.sdsu.edu
Wed Sep 30 13:58:22 EDT 2009
Hi All,
In my OnCreate scrip, I check to see whether I really want this ticket
to be created based on various criteria in the message headers. RT
creates the ticket before the scrip runs, so if I decide that I don't
want it, I trigger another scrip that deletes the ticket. Not real
elegant, but it does the job. My delete scrip logs that the ticket got
deleted, but the RT generates its own log entry that the ticket was
created. So my rt.log ends up looking like this:
Ticket #1219 from xyz at abc.com deleted. ((eval 475):5)
Ticket 1219 created in queue 'beer' by xyz at abc.com
(/path/to/rt/lib/RT/Ticket_Overlay.pm:754)
The first log entry is mine documenting the ticket deletion. The next
one is RT's documenting the ticket creation.
This can be confusing, so I'd like to stop RT from making that final log
entry if I can.
I'm guessing that RT is using a stack to keep track of log entries, so
the first transaction (the ticket creation) ends up at the bottom of the
stack and gets written to the log after my manual log entry from the
OnCreate scrip. Can I pop it off the stack so that it just goes away or
make my ticket deletion log entry be written after RT's ticket creation
entry (pop, $RT::Logger->info(), push)?
Thanks,
Gene
More information about the rt-users
mailing list