Hi @DBrowning I tried setting up an extension attribute as you provided up here but seems like it is not working, attaching the screenshot. same result in catalina and bigsur. Nothing won't populate even after jamf recon.
EDIT: After waiting a while and after a Recon it actually populated correctly.
Well, you have a 'sudo' in a place where it makes no sense. DBrowning has the complete and correct script in his post. Please note that if you run this outside of Jamf you need to run it with sudo privileges. When from the MDM it already has sudo privileges.
Once you fixed the EA check you get the proper result in the inventory for the device on which you tested. When that is OK check the smart group, you might have problems there as well.