The messageId can be accessed with the {MSGID} node tag. It can be wrapped in a qie.evaluateTemplate() call like this:
qie.evaluateTemplate("{MSGID}");