Bug 1411424

Summary: Expose miq_groups to Automate
Product: Red Hat CloudForms Management Engine Reporter: Satoe Imaishi <simaishi>
Component: AutomateAssignee: mkanoor
Status: CLOSED CURRENTRELEASE QA Contact: Dmitry Misharov <dmisharo>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.7.0CC: jhardy, mfalesni, mkanoor, obarenbo, tfitzger
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.8.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1411473 (view as bug list) Environment:
Last Closed: 2017-06-12 17:34:55 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1411473    

Description Satoe Imaishi 2017-01-09 16:58:55 UTC
From PR https://github.com/ManageIQ/manageiq/pull/12294:

This PR exposes a user's groups to the Automate engine, addressing a use case presented on ManageIQ Talk: http://talk.manageiq.org/t/how-to-get-multi-groups-of-a-user-in-automation/1799

Steps for Testing/QA

Display a user's groups in an Automate method:
  groups = $evm.vmdb(:user).first.miq_groups
  $evm.log(:info, "Displaying the user's groups: #{groups.inspect}")

Comment 3 Milan Falešník 2017-03-03 13:17:40 UTC
Verified in 5.8.0.3

<AEMethod [/qqq/System/Request/mytest]> Starting 
<AEMethod mytest> Displaying the user's groups: [#<MiqAeServiceMiqGroup:0x107f2f0 @object=#<MiqGroup id: 2, description: "EvmGroup-super_administrator", group_type: "system", sequence: 1, created_on: "2017-03-03 03:20:03", updated_on: "2017-03-03 03:20:03", settings: nil, tenant_id: 1>, @virtual_columns=["allocated_memory", "allocated_storage", "allocated_vcpu", "custom_1", "custom_2", "custom_3", "custom_4", "custom_5", "custom_6", "custom_7", "custom_8", "custom_9", "miq_user_role_name", "provisioned_storage", "read_only", "region_description", "region_number", "user_count"], @associations=["tenant", "users", "vms"]>]
<AEMethod [/qqq/System/Request/mytest]> Ending