-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Summary
When configuring job templates with surveys using the multiplechoice type for boolean fields (choices: [false, true]), editing or selecting the "false" option fails. This results in a JavaScript error in the Ansible Automation Platform (AAP) UI, auto-deselecting the option, and preventing the template from launching since the field is required. Selecting "true" works fine.
This issue occurs when using the infra.controller_configuration collection to manage AAP 2.4 configurations, likely during survey import or update via the roles.
Steps to Reproduce
- Use the collection to create or update a job template with a survey spec like the one below (e.g., via the
configure_controllerrole or similar). - In the AAP UI, navigate to the job template and attempt to launch it or edit the survey values.
- Try to select "false" in the boolean multiplechoice field.
- Observe the error in the browser console and the failure to launch.
Survey Spec (from API)
The problematic survey spec from /api/v2/job_templates/1669/survey_spec/:
{
"name": "Inputs",
"spec": [
{
"max": 0,
"min": 0,
"type": "multiplechoice",
"choices": [
"MSPF.IPS.CARDFALLBACK"
],
"default": "",
"required": true,
"variable": "sos_property_name",
"new_question": true,
"question_name": "Select the desired property",
"question_description": "The given property will be the property to be changed"
},
{
"max": 0,
"min": 0,
"type": "multiplechoice",
"choices": [
"LX",
"VS"
],
"default": "",
"required": false,
"variable": "sos_site",
"new_question": true,
"question_name": "Select the destination site: (if none is selected both sites will run)",
"question_description": "Select the site where the property will be changed"
},
{
"max": 0,
"min": 0,
"type": "multiplechoice",
"choices": [
false,
true
],
"default": "",
"required": true,
"variable": "sos_value",
"new_question": true,
"question_name": "Select the value:",
"question_description": "Select the value for the property"
}
],
"description": "Inputs for switching properties on the desired site"
}Error Message
When trying to edit/select "false":
- UI shows: "Something went wrong... There was an error loading this content. Please reload the page. Back to Dashboard."
- Browser console error:
TypeError: n.trim is not a function
at https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:3051600
at Array.map (<anonymous>)
at Yle (https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:3050871)
at ao (https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:832922)
at Ks (https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:885266)
at Al (https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:872512)
at Tl (https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:872440)
at El (https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:872303)
at yl (https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:869269)
at https://aap-controller-qly.svc.sibs.pt/static/js/main.4aab3535.js:2:818714
- Behavior: Selecting "false" auto-selects no option. The template cannot be launched due to the required field. "true" selects and works.
Environment
- AAP Version: 4.5.24
- AWX/Controller Collection: ansible.controller >=4.5.0,<4.6.0
- Template Creation: Created via ansible-playbook with
infra.controller_configuration.configure_controller.yml
Expected Behavior
Boolean choices in multiplechoice surveys should render and select properly without JavaScript errors. "false" should be selectable like "true", allowing the template to launch.
Please let me know if you need more details or help investigating!
Why is the documentation for surveys in this collection (and AAP in general) almost non-existent? There is little to no guidance on how to properly configure survey specs, especially for edge cases like boolean values in multiplechoice fields, which makes debugging issues like this significantly harder.