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

Kevin Falcone falcone at bestpractical.com
Wed Aug 13 09:44:14 EDT 2014


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.

> ### 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.

> > 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.

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 235 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20140813/ada08133/attachment.pgp>


More information about the rt-users mailing list