RT 4.2 Watcher code in both lib/RT/Ticket and lib/RT/Queue? - which should be modified?

Hi!

I’m attempting to write a plugin to add some extra watchers in RT 4.2.5. In searching the codebase I’m finding what appears to be copies of the same watcher code in both lib/RT/Queue.pm and in lib/RT/Ticket.pm. (I’m looking at AddWatcher, DeleteWatcher, IsWatcher, and the 'sub’s for the watcher names themselves (Cc, AdminCc, and Requestors (which is only in Ticket.pm??)))

Are both of these used? I.E. will I need to augmenting both if I want to add some new watchers system wide?

Thanks!
-Mike

Hi Mike,

Both code paths are used, as both Queues and individual Tickets can have Watchers. So you will need to augment both to add new Watchers if you want them to apply to both Queues and Tickets. Only Tickets have Requestors, so only Ticket.pm knows about Requestor-type Watchers.

Can you say more about what you’re trying to achieve by adding extra Watcher types? There may be ways to achieve your goals which don’t require such invasive surgery.

  • KevinOn Sep 10, 2014, at 9:21 , Mike Lutz wrote:

Hi!

I’m attempting to write a plugin to add some extra watchers in RT 4.2.5. In searching the codebase I’m finding what appears to be copies of the same watcher code in both lib/RT/Queue.pm and in lib/RT/Ticket.pm. (I’m looking at AddWatcher, DeleteWatcher, IsWatcher, and the 'sub’s for the watcher names themselves (Cc, AdminCc, and Requestors (which is only in Ticket.pm??)))

Are both of these used? I.E. will I need to augmenting both if I want to add some new watchers system wide?

Thanks!
-Mike


RT Training - November 4-5 Los Angeles
Training — Best Practical Solutions

smime.p7s (4.35 KB)