Dynamic fields and call API


We have an application who do API call to MIQ (Catalogs) and retrieve dynamic fields (for example vlan list). We work with Gaprindashvili-1 version. This works fine but we try with the version Gaprindashvili-7 and with the same API call, the dynamic fields wasn’t calculate.

The call we use is “/api/service_dialogs/2?expand=resources”. Normaly, we should have in dialog_fields something like : { “values”: [[“13”, “”], [“27”, “”]] }, but with the Gaprindashvili-7, nothing.

I saw that in Gaprindashvili-3, there was a refactor in dialog field. So now, how can retrieve dynamic field with API call ?


You can call Automate Methods via the /api/automation_requests Endpoint (Docu)


We noticed the missing initial values of dynamic fields in the API response too after upgrading from Fine to Ivanchuk. You can call the “refresh_dialog_fields” action to refresh the given field(s) and retrieve their dynamically generated initial value(s). More info: https://www.manageiq.org/docs/reference/latest/api/examples/refresh_dialog_fields

You can leave the “dialog_fields” hash empty to retrieve the initial values of the dynamic fields specified at “fields”. In the following example we retrieve the initial values of the dynamic pull down list named “network”:

POST /api/service_catalogs/3/service_templates
Body {
  "action": "refresh_dialog_fields",
  "resource": {
    "href": "http://localhost:3000/api/service_templates/11",
    "dialog_fields": {},
    "fields": [