Change subject after reply (two ticket systems)

Change subject after reply (two ticket systems)

Good day,

we have the problem that we have partly on the other side also a ticket system (so no single person) and this of course also needs a ticket number in the subject.

So we have the following workflow:
1. we open a ticket
2. email goes to the other ticket system with our ticket number (e.g. [## 123123 ##] ticket text)
3. the other ticket system answers with an own number and changes the subject (e.g. [TICKET - 123123] [## 123123 ##] Tickettext)
4. the subject in our Zoho would now have to be changed so that BOTH ticket numbers are in it (otherwise there will be a ticket system ping-pong)

How can this be implemented? Via a workflow? A custom function?
The ticket numbers are always the same length or with the same structure (you could use e.g. RegEx).

We need support here 

Thanks