Add createTicket function.