I’ve been doing a spot of hacking using the RT Perl API to manage/munge scrips and templates (hopefully to allow Ansible to deploy updated scrips/templates from one RT instance to another eventually).
However, when using the RT::Scrip->AddToObject()
method, it seems to blow up if I specify a Template
(a string identifying the template) in the parameter hash. I was thinking this was how a scrip is tied to a queue specific template. The code fragment looks like this:
my ($ret, $msg) = $scrip->AddToObject(
ObjectId => $queueObj->id,
Template => 'Blank',
);
From the error tracing his appears to die because that method ends up trying to run:
INSERT INTO ObjectScrips (LastUpdatedBy, Template, Stage, Created, Creator, ObjectId, SortOrder, Scrip, LastUpdated) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
and there isn’t a Template column in the ObjectScrips table.
This is with a 5.0.7 RT (upgraded from 5.0.5), and the RT documentation seems to say that Template
is a valid parameter to that method. If I remove the Template
parameter and then add in other parameters given in the documentation such as Stage
or SortOrder
the call works OK.
So am I doing something stupid, or is there a bug in either the documentation or the RT code? Do I even need to specify the template I want to use per queue, or should it just be the same template name in the RT::Scrip
object and RT’s logic will find the per queue version at run time?