there is random numbering, but id refers to the sequential ticket number for database purposes. Random numbering is another field, used for external purposes. The email is for the external users, who use the random number for reference. Internally we use the id.
You should be able add the following to include/class.ticket.php ~ line 958 AFTER
//SEND OUT NEW TICKET AUTORESP && ALERTS.
//New Ticket AutoResponse..
if($autorespond && $cfg->autoRespONNewTicket() && $dept->autoRespONNewTicket()){
$sql='SELECT ticket_autoresp_subj,ticket_autoresp_body FROM '.EMAIL_TEMPLATE_TABLE.
' WHERE cfg_id='.db_input($cfg->getId()).' AND tpl_id='.db_input($cfg->getDefaultTemplateId());
$resp=db_query($sql);
if($resp && list($subj,$body)=db_fetch_row($resp)){
$subj = str_replace("%ticket", $ticket->getExtId(),$subj);
$body = str_replace("%ticket", $ticket->getExtId(),$body);
ADD
$subj = str_replace("%ticketid", $ticket->getId(),$subj);
$body = str_replace("%ticketid",$ticket->getId(),$body);
Then you should be able to use %ticketid in the ticket template.