I made that way too hard.  There isn't any need to know anything but the login.  You can just add <nowiki><pre>
    set comment "&lt;i>[htmlize $login] posted on [date]&lt;i>&lt;br>\n$comment"

above the <code>submit_ticket</code> command.