Stop/Defer running further scrips?

Hello All

We receive a lot of maintenance announcements of service providers to our RT instance. Most of them are being followed up with related messages (reminders/beginning/finished/etc.).

I have made an RT extension that matches up those follow-up mails to the original announcement. This works mostly well, but one thing is bothering me: even tough I the follow-ups are merged into the original ticket (by a global scrip) RT is executing later scrips (e.g. auto-reply / on open / etc.).

Is there any way to circumvent this behaviour? So far my searches turned up a ‘no’, but maybe I am missed something?
Would setting the ticket to open/resolved before merging it into the original (still open) ticket prevent the new-ticket scrips to be running?

Any creative ideas/approaches to reduce the amount of mails received by external/non-owning recipients appreciated.

Regards
Roman

You can try overlaying the ParseTicketId function in RT::Interface::Email.pm if you add your logic in their for checking if a follow-up email is for an existing ticket and load the existing ticket ID and return it, RT will reply on that ticket instead of creating a new one.

Hmm. Sounds a bit more invasive than I would trust my self go into…

Can you elaborate on how exactly this would influence the normal mailflow/scrip processing? E.g. would RT consider the freshly received mail to be reply to an existing ticket and follow that path or would it still consider it a new ticket in run autoreply, etc.?

Yup, that function is what checks for the subject tag matching an existing ticket or not. If one is found then the email coming in is recorded as a reply instead of a ticket create. You could test by hard coding a ticket ID and checking for a very specific subject line and sending an email with that subject:

if ( $Subject =~ /My Test Subject/ ) {
   return id_of_existing_test_ticket;
}