[rt-users] Change ticket subject before first outgoing correspondence.
mikemol at gmail.com
Thu Aug 7 14:00:01 EDT 2014
On Thu, Aug 7, 2014 at 12:39 PM, Kevin Falcone
<falcone at bestpractical.com> wrote:
> On Fri, Aug 08, 2014 at 01:00:16AM +1000, Alex Peters wrote:
>> I wonder whether both moving the subject-renaming scrip to execute first, and
>> modifying the emailing scrip to run at the "batch" stage might solve your
> While it's possible to alter the Autoreply template to fetch the newer
> subject, making the On Create Autoreply to Requestors Scrip be in the
> Batch stage is the easier and correct solution.
> Batch scrips are executed after all other Scrips, so ordering them is
I don't have an On Create Autoreply to Requestors scrip. I think I
deleted it early, early on in this install since root at somebox doesn't
need a reply when some cron job or management agent generates an email
from that address.
I did go through and set *every* scrip with a Notify action to run
during the TransactionBatch stage, but that had no effect. (Setting
them to Disabled does result in my not receiving an email; I'm on the
AdminCC for all created tickets).
I tried some things in response to Alex's emails, and replied, but
didn't realize those weren't going to the list. I'll reproduce that
(or the gist of it) below:
* Scrip re-ordering appears to be a feature of the 4.2 line of RT. I'm
running the vendor packages of RT 4 on Ubuntu 14.04.
* I looked into upgrading, but I did not find any repositories making
backported packages available to 14.04. Pity; I selected 14.04 so I
wouldn't have to override the system as often.
* Even though I can't reorder scrips, I can create disable global
scrips and create local scrips with the same name, resulting in a
higher ID number (and theoretically later execution). However, this
has no apparent effect, regardless of whether I run the overriding
Notify scrips in the TransactionCreate or TransactionBatch stages.
I'm beginning to wonder if I need to set something beyond just the
ticket subject in my scrip. The scrip doing the work in question will
### Begin snippet
# Find the message from transactionobj->content
# Set the subject to the message by using ticketobj->SetSubject
my $body = $self->TransactionObj->Content;
my @lines = split(m/\n/, $body);
my $trapID = $lines;
my $message = $lines;
$RT::Logger->warn("Setting RT ticket subject: " . "$trapID -- $message");
$self->TicketObj->SetSubject("$trapID -- $message");
### End snippet
My last option appears to be to write a template that duplicates the
above logic in the template itself, which feels dirty, and looks
More information about the rt-users