Actually, I'm second-guessing my (untested) advice now because I suspect that both scrips would run on the initial transaction—that is, the emailing scrip might not necessarily pick up on the subject change because that would be a different transaction.
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 problem. On 8 August 2014 00:55, Alex Peters <[email protected]> wrote: > You can adjust the order in which scrips run by moving them up and down in > the list. > > I'm guessing that both scrips have the "on create" condition. Simply swap > their order on the queue's Scrips page (or the global one if necessary), > and I believe everything should work as you expect. > > > On 7 August 2014 22:52, Michael Mol <[email protected]> wrote: > >> So I have a scrip which runs at at the TransactionCreate stage for a >> queue, checks the subject and the body, and then rewrites the subject >> to something informative. >> >> It works; when I look at the ticket for inbound emails matching the >> condition, the subject is precisely what I want it to be. >> >> Except that the first outgoing email is sent before the subject is >> rewritten; in my inbox, the message still reflects the original title. >> This happens whether I put my scrip's action code in the prepare or >> cleanup stages. >> >> From an external perspective, this is what the sequence looks like: >> >> 1. RT receives an email with a subject of "Foo" and a body of "Bar\nBaz" >> 2. RT sends me an email with a subject of "[queuename #999] Foo" and a >> boxy including "Bar\nBaz" >> 3. I look at queuename #999, and I see a ticket with subject of Bar -- >> Baz. >> >> While what I *want* to happen is: >> >> 1. RT receives an email with a subject of "Foo" and a body of "Bar\nBaz" >> 2. RT sends me an email with a subject of "queuename #999] Bar -- Baz" >> 3. I look at queuename #999, and I see a ticket with a subject of Bar -- >> Baz. >> >> How do I get that first email to reflect the desired ticket subject? >> >> -- >> :wq >> -- >> RT Training - Boston, September 9-10 >> http://bestpractical.com/training >> > >
-- RT Training - Boston, September 9-10 http://bestpractical.com/training
