[rt-users] Change ticket subject before first outgoing correspondence.

Michael Mol mikemol at gmail.com
Wed Aug 13 10:15:50 EDT 2014


On Wed, Aug 13, 2014 at 9:44 AM, Kevin Falcone
<falcone at bestpractical.com> wrote:
> On Mon, Aug 11, 2014 at 11:55:00AM -0400, Michael Mol wrote:
>> Oh, that's good to know! I searched for at least an hour trying to
>> find that precise piece of information.
>
> It is all over the mailing list archives, answered at last monthly
> these days.  It should also be in the wiki.

The best I can say is that I *loathe* having to ask questions of
mailing lists and IRC channels, as I expect to get answers like this.
I seriously hate getting replies intoning that the information is
readily available, so I do the best I can using Google and reading all
the available documentation I can find. I may have spent more than an
hour looking for that precise piece of information, but I spent more
than a week digging through all the available documentation on the
wiki and BestPractical's website docs. The wiki consists primarily of
tutorials.

If it's in the mailing list archives, either my google-fu must be
weakening, google unhelpfully directed me toward the wrong resources
based on search history, or I didn't have the right keywords.
"requesttracker scrip ordering" didn't get me anywhere.

I apologize if I'm a bit bristly, but I've always spent at least
several hours searching and reading before opening a thread on a
mailing list or IRC channel, because I hate "RTFM" or "LMGTFY"
responses.

>
>> ### Begin snippet for custom action preparation code
>> # 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[0];
>> my $message = $lines[2];
>>
>> $self->TicketObj->SetSubject("$trapID -- $message");
>> ### End snippet for custom action preparation code
>>
>> ### Begin snippet for custom action cleanup code
>> # No cleanup necessary; all the work was done in the prep stage.
>>
>> return 1;
>> ### End snippet for custom action cleanup code
>
> This is dangerous.  RT executes the Prepare during scrip prep without
> doing the Commit.  You should never make changes in the Prepare.

Good to know. I did not find documentation describing the precise
processing behavior of RT scrips.

>
>> > I've seen your rewritten template, but a Notify scrip running in the
>> > transaction batch stage which has merely
>> >
>> > Subject: { $Ticket->Subject }
>> >
>> > should be more than sufficient, assuming it runs after your Subject
>> > modification scrip, preferably in a TransactionBatch scrip on the same
>> > Condition.
>>
>> Interesting. Where does the subject come from, if not
>> $Ticket->Subject? (I guess I could just look at the source code for
>> that.)
>
> Have you tried my suggestion yet?
>
> The answer is, at best, complicated.

I have not. I have something that works (though I'll be sure to move
my code from Prepare to Cleanup), and I'm not in a rush to change that
with as much as I have on my plate. I have another pattern of emails I
want to process similarly (certain cron job messages), so I'll give it
a try there and follow up if I can.

-- 
:wq



More information about the rt-users mailing list