[rt-users] How do I override a default scrip?

Bill Cole rtusers-20090205 at billmail.scconsult.com
Fri May 18 23:51:48 EDT 2012


On 18 May 2012, at 17:40, Paul Tomblin wrote:

> On Fri, May 18, 2012 at 3:47 PM, Bill Cole
> <rtusers-20090205 at billmail.scconsult.com> wrote:
>> Another option is to modify the Global Scrip with a User Defined 
>> Condition
>> that returns 0 if the Queue is one that you want to exempt.
>
> How do I programmatically add one of these User Defined Conditions to
> an existing RT Global Scrip?  (Preferably something that I can do in
> my etc/initialdata)

Ewww. Why???

With a running RT (i.e. a system where etc/initialdata has seen its 
single lifetime access) just go into the Scrip's definition 
(Configuration->Global->Scrips->$WhicheverOneYouAreChanging) and switch 
the "Condition" from whatever it is (e.g. "On Comment") to "User 
Defined" and put some suitable perl in the "Custom condition" text area. 
See http://requesttracker.wikia.com/wiki/WriteCustomCondition for clues 
on suitable perl. See 
http://requesttracker.wikia.com/wiki/Documentation#Scrips for more links 
to doc on Scrips.

I suppose you *could* do the needful to put your custom scrip into 
etc/initialdata, but I can't see a way to make that a rational thing to 
do. It's name has meaning...


>>> If I define a new
>>> scrip with the same name as an existing one, it runs both of them.
>>
>>
>> Yes, it does. Scrips are objects that point to Queues by ID, Queues 
>> are not
>> objects that point to Scrips by name.
>
> I'd just like to point out that's completely inconsistent with the way
> Templates are done.

You may want to have "inconsistency" discussions with Jesse Vincent. I 
gave up trying to understand the reasoning behind RT internal 
architecture a couple of major versions ago. It wasn't a hobby that was 
making me happy... Now I just try to keep the useful facts in my head 
without judging what I really don't understand.

With that caveat, I think it's not true that the way Scrips relate to 
Queues is inconsistent with Templates. Templates also are either 
Queue-specific or Global and point to their Queue by ID, rather than the 
Queue pointing to them by name. This is pretty much orthodox data 
structuring.



More information about the rt-users mailing list