Are you using Lock Code Manager (LCM)?
My zigbee-module Yale Assure will report the Name of the user (from LCM) who unlocked, but not the code itself.
In Rule Machine, you can then use a trigger like this ("Guest" is actually a Name/code I have in LCM)
If you're not currently using LCM and just have the lock codes programmed directly into the lock itself, I think you need to follow the steps at the bottom of this post to reset the lock & module data -- then it can get everything cleanly from LCM.
(Someone please correct me if that info is no longer current)