- What is the nature and description of the request?
When searching for items in the Controller Web UI, applying an organization filter works differently for different objects being searched:
- Inventories and Teams have a "basic" search by Organization name.
- Templates can apply an Organization name filter to an Advanced Search.
- Users do not allow an Organization filter when using Advanced Search.
- Credentials, Projects, Inventories, Teams, Notification Templates, Applications and Execution Environments allow the user to select 'organization' as a filter field in Advanced Search, but it actually searches for organization id, not organization name. If the user enters text in one of these fields and searches, they get a "Something went wrong" error asking them to reload the page. Expanding the details shows that the search is making an API call with an organization id search but passing in the search string (which fails).
- Why does the customer need this? (List the business requirements here)
The customer has over 50 organizations on the platform, and many organizations have RBACs to create and manage their own credentials. To troubleshoot, the platform team want to be able to search for credentials (and other objects) with an organization filter.
- How would you like to achieve this? (List the functional requirements here)
'key name' dropdown selection boxes in searches for Credentials, Projects, Inventories, Teams, Users, Notification Templates, Applications and Execution Environments should include both 'organization_id' and 'organization_name' as options (or, alternatively, all should default to organization_name).
Searching an id field with a text value should give a more useful error than just 'Something went wrong...'
- List any affected known dependencies: Doc, UI etc..
In this case, the API supports both id and name filtering by organization.
https://<ansible_controller>/api/v2/credentials/?order_by=name&organization__exact=Test&page=1&page_size=20
(FAILS)
https://<ansible_controller>/api/v2/credentials/?order_by=name&organization_name_exact=Test&page=1&page_size=20
(WORKS)
However, the Web UI does not allow both options, and sometimes uses name, sometimes uses id.
- Github Link if any
n/a