You can get it using: System.getModule("com.vmware.library.vc.customattribute").getCustomField(VM, "name")
Thanks for the response but that line doesnt seems to be working it gives me the following error:
TypeError: Cannot read property "customFieldsManager" from undefined (Dynamic Script Module name : getCustomField#8)
I verified that I can see the attribute in vcenter on the vm just cant seem to get it with vro
Looks like there is something wrong with your installation. What vSphere and Orchestrator versions are you using? Can you check vRO Configuration (https://vro:8283) if all the plug-ins are installed and loaded?
Finally, I found way how to reproduce your error.
Make sure that "VM" is only one VcVirtualMachine and not array of VMs.