Description
When using the "Copy Request" button in ManageIQ to reload a service request form, some fields fail to display correctly. Specifically, the dropdown values that were correctly populated during the initial request from the catalog are not displayed when copying the request.
Actual Behavior:
After using the "Copy Request" button, the following error appears in the console:
SyntaxError: Unexpected token 'G', "GRP_All_FR" is not valid JSON at JSON.parse (<anonymous>)
Additionally, the form fails to display certain fields (e.g., dynamic dropdowns) that were initially populated correctly.
Relevant Code (Dynamic Dropdown Logic):
dialog_field = $evm.object
dialog_field['values'] = nil
service_template = $evm.vmdb(:service_template).find_by_id($evm.root.attributes['service_template_id'])
if service_template['name'] !~ /RDS|AURORA/
passhport_grp = "/Config/PaSSHPort/Groups/GRP_*"
else
passhport_grp = "/Config/PaSSHPort/Groups/GRPBDD_*"
end
template_hash = { nil => "<Choose>" }
$evm.instance_find("#{passhport_grp}").each do |k, v|
template_hash[v['name']] = "#{v['description']}"
end
dialog_field['values'] = template_hash unless template_hash.length == 0
Additional Notes:
This issue does not occur when loading the form for the first time via the catalog. It only happens after copying the request.
There are no error logs generated on the server side related to this behavior.
Can you confirm if this is a known issue or if there are any workarounds for dynamic dropdowns in this context?
Steps to Reproduce:
Create a service request via the catalog where dropdown fields are populated dynamically (e.g., based on external resources like groups or instances).
Use the "Copy Request" button to copy the service request.
Observe that some fields (such as dropdowns) are not displayed or populated correctly after the copy.
- Describe environment, including
- Quinteros
- Environment
- EC2 appliance