Keep Subject from incoming Email to existing Ticket


i want to couple 2 ticket systems. My is RT and a customers helpd desk also working with ticket numbers parsed via subject.


  • Ticket is initiated and sends mail to a dedicated email address of the customers helps desk
  • Help desk of the customer initiate a new ticket with a) rt ticket numer and b) its own number
  • Answer is sent by the customers ticketsystem - i see both numbers in the subject
  • When i reply on the ticket, the subject is equal to the original subject (without customers ticket id) - so customers ticket system opens a new ticket

I can set the subject manually on replay but this is not acceptable. How can i keep the customers id in the subject?

Thanks in advance,


How about an “On Correspondence” scrip that looks to see if the message has come from the customer’s system and if the ticket subject in RT doesn’t have their ID number in it, and if not, updates the RT ticket subject appropriately?

Sounds good and should solve the problem but i am not able to write this script. :-/

Isn’t this what the $ExtractSubjectTagMatch setting is for in the RT config?

To the OP: what does the ticket id number from the external helpdesk look like in the message subject?

1 Like

The subject contains: “Ticket-Nr. SU2309-0298” followed by some text and the rt ticket no. Here the complete subject from a test ticket:
Rückfrage zu Ticket-Nr. SU2309-0298 zum Thema: [Extern] [RT #1907] Test Ticketsystem
The part including [Extern] is set by the customers system, the rest by rt

Thx in advance!

Hi @MuckiSG

There is the point in the workflow as @GreenJimll mentioned:
If your system is the first that opens the ticket you have to update the tickets subject if the answer is received. You see the external number in transaction-subject, only.

Step 1: Test
Update tickets subject manually. (“The Basics”->“Subject” or “Grundlagen”->“Betreff”)
I would do this at least to proof the conept. So make sure it works after that.

In daily work it can be done by staff, too. Depends on the count of tickets. A few a week is ok. More than that or less than two a month needs automation.
We do it still manually.
Additional we put the external Ticket-ID in a CustomField (one for all) to search for this ID.

Optional: Automate
I see no other way than coding as Scrip.

  • Condition: On Correspond
  • Custom preparation code: Test if sender is other ticket-system, continue or quit
  • Custom commit code: Set tickets subject to the value of transactions subject

I do not have this code, yet an I am too bad to code this on the fly. So I cannot share code.

Step 2:
Prevent email-loops!!!
You have to care for automatic answers of the systems. Each external system is different an needs to be analyzed for this.
Often the “On Resolve” leads to reopen the ticket in the other system.

Regards, Andre.

Thanks @rubberduck,

i am not sure what $ExtractSubjectTagMatch exactly does but i going to figure that out today. Just an regex to filter the subject.

Scripting in RT is not my world, so i have to hire somebody. Not easy in Germany but i know somebody who might help me.

Email-looping is well known as a problem and in our case it works fine but always a good point in connecting different ticket systems.

I will publish the solution when it is working, hope next week.

Thanks and have a nice weekend,


Ok, I did not know this Scrip-Action and cannot find it in 4.4.6 actions. I’ll look on rt5 test-system.
So it seems to do what one need to do, change the subject.

Viele Grüße, Andre.