Disable a global RT scrip for some queues

We're using RT quite a lot. Today I needed to disable some 'Scrips' in one queue, while keeping the in all other queues. Unfortunatly, RT does not support this out of the box. While there is a plugin that seems to implement that feature (RT-Extension-QueueDeactivatedScrips) I decided to fix this without touching RTs innards.

The trick is to add a 'Custom condition' to the global script, which returns false for the relevant queue:

return $self->TicketObj->QueueObj->Name ne 'babilu::support'

Unfortunantly, this is not enough (and it took me some testing and manic clicking through RT to figure this out). You also need to change the 'Condition' from whatever the Scrip is using to 'User Defined', and then test for the condtion yourself:

return (
   ($self->TransactionObj->Type eq "Correspond")
   &&
   ($self->TicketObj->QueueObj->Name ne 'babilu::support')
)

2 Comments

If this is an On Correspond Notify Foo using CorrespondTemplate scrip, you can disable it on the queue level by creating a Queue level CorrespondTemplate template which is blank. RT won't send any email if the template is empty. Just make sure that the template you override won't affect other scrips (you can always change your one scrip globally to use a different template to make separating and overriding them easier).

Leave a comment

About domm

user-pic Just in case you like to know, I'm currently full-time father of 2 kids, half-time Perl hacker, sort-of DJ, bicyclist, no longer dreadlocked and more than 34 years old but too lazy to update my profile once a year. I'm also head of Vienna.pm, no longer maintainer of the CPANTS project, member of the TPF Grants Commitee and the YAPC Europe Foundation. I've got stuff on CPAN, held various talks and organise the Austrian Perl Workshops and YAPC::Europe 2007.