Pass Discovered VM IP/hostname to custom button #23089
-
I am trying to create custom buttons to install a package on a VM. Steps followed:
When I select that button, a dialog pops up with input for hosts, I want to pass on the IP of the VM we selected automatically in the hosts field of dialog. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
This wouldn't typically be done in the dialog, because as you're trying to do, you'd prefer it done automatically. Instead, the custom button should be connected to an Automate entry point and part of the incoming Automate playload is the object on which the custom button was clicked (in this case the VM). From there you can get any details you need from the VM object via |
Beta Was this translation helpful? Give feedback.
-
Thanks! @Fryguy |
Beta Was this translation helpful? Give feedback.
This wouldn't typically be done in the dialog, because as you're trying to do, you'd prefer it done automatically. Instead, the custom button should be connected to an Automate entry point and part of the incoming Automate playload is the object on which the custom button was clicked (in this case the VM). From there you can get any details you need from the VM object via
$evm.root['vm']
. In Automate there is also$emv.root['vmdb_object_type']
which will allow you to know the where the Automation method is being called from (if a custom button on a Vm, it should be set to'vm'
for example.