There is a difference in what filters can be used on the GUI to the API.
The GUI rejects valid options that the API accepts and are valid.
Using the GUI, which fails:
Using the API, which works:
{
"name": "Smart Inventory Test",
"description": "Testing",
"organization": 2,
"kind": "smart",
"host_filter": "groups__name=GROUP1 or groups__name=GROUP2",
"variables": "",
"insights_credential": null
}
GUI can use the same filters as the API.
The GUI failed to use the filter.
+1
the same for:
/api/v2/hosts/?order_by=name&page_size=5&inventory__organization=2&host_filter=(search=HOSTNAME1%20or%20search=HOSTNAME2)
Really annoying I had this problem too and stuck with running curl requests to build my smart filters.
also this stupid syntax of __ is not very well explained
equivalent GUI examples are not provided.
We should not have to search though bug reports to find good examples of the syntax.
curl -sXPOST http://admin:blahblah@server/api/v2/inventories/ -d @smartfilter -H "Content-Type: application/json"
Smartfilter file
{
"name": "DEV Website Inventory",
"description": "All development servers ",
"organization": 1,
"kind": "smart",
"host_filter": "name__icontains=sd1d or name__icontains=sd2d or name__contains=hd1d",
"variables": "",
"insights_credential": null
}

Trying to do the same thing in the gui (its like it is splinting the search on a space token) but I

Resolved via https://github.com/ansible/awx/pull/2847
Most helpful comment
Really annoying I had this problem too and stuck with running curl requests to build my smart filters.
also this stupid syntax of __ is not very well explained
equivalent GUI examples are not provided.
We should not have to search though bug reports to find good examples of the syntax.
Smartfilter file
Trying to do the same thing in the gui (its like it is splinting the search on a space token) but I
