Assuming you are wanting to iterate the tags of the group who is the “owner” of the VM object you then could use something to the tune of:
user = vm.owner
$evm.log("info", "===== Owner: #{user.inspect}")
group = vm.owner.current_group
$evm.log("info", "===== Group: #{group.inspect}")
miq_group = user.current_group
unless miq_group.tags.nil?
$evm.log("info","#{@method} - Group:<#{miq_group.description}> Begin Tags [miq_group.tags]")
miq_group.tags.sort.each { |tag_element| tag_text = tag_element.split('/'); $evm.log("info", "#{@method} - Group:<#{miq_group.description}> Category:<#{tag_text.first.inspect}> Tag:<#{tag_text.last.inspect}>")}
$evm.log("info","#{@method} - Group:<#{miq_group.description}> End Tags [miq_group.tags]")
$evm.log("info","")
end
if you instead wanted the current logged on user, then use the following:
user = $evm.root[‘user’]
at the very least this should get you primed on what info you need.