Change the type of ID
You have to use ticket number instead of ticket id in your autoresponds. (you may use the random ticket numbering, which is not the same as the physical id in database.)
Replace in your templates:
.../scp/admin.php?t=templates
%id
=Ticket ID (internal ID)
to:
%ticket
=Ticket number (external ID)