How to build a query in the "Custom List" that uses a custom field type multiselect and I want to make a "contains" on a certain part of the allowedvalue string.
e.g. Custom List Vehicle Type have following values among many.
I would expect to be able to get all workitems returned that is assigned to the allowedvalues that contains "Car" using below query in the custom list app.
(c_Vehicle contains "Car")
(c_Vehicle containsany "Car")
However, this does not work, the only way to get all items assigned to values that contians "Car" is to create an OR query that lists all of the values that contains "Car" e.g. ((c_Vehicle contains "Car - SUV") or (c_Vehicle contains "Car Wagon"))
Any one who knows how to do that... Note, it is possible to use contains on Tags.Name, but seems not to work on multidropdown...
I haven't tested this exact scenario but see if these works better for you.
(c_VehicleType.DropDownField contains "Car")
Correction: I just tested it, and it works great in the Excel Add-in and in Rally/Agile Central.
I get below message when using the ".DropDownField" in the query field in the Custom List App.
Could not parse: Attribute "DropDownField" on type AllowedAttributeValue is not allowed in query expressions
Is the name of the drop down "Vehicle"? if so drop the "Type"
(c_Vehicle.DropDownField contains "Car")
I don't have an actual Multi-Value Drop-Down List set up yet to test myself, but I wonder if using MultiValueField would work?
(c_Vehicle.MultiValueField contains "Car")
Unfortunately the "contains" operator with multi-value drop downs does not work the way you might expect it to and still requires you to pass the entire string for each value. The example below does not really solve your issue in this case but it does make for a little cleaner query. Using the "containsany" operator works like and "OR" where each value is comma separated. We also have the "containsall" operator which acts as a comma separated "AND".
I hope that is helpful to you.
(c_VehicleType containsany "Car - Wagon,Car - SUV")
That is very helpful, thanks for the contains any. However I find it inconsistent that can't do contain on parts of the values in a multiselect dropdown. You can on the Tags.Name field, which seems very similar to multiselect dropdown.
I agree it is counter intuitive but that is the way the code was written for that particular field.