Hi there!
i’m struggeling with retrieving data using rest 2.0. Apparently i don’t know how to build a query which contains a custom field.
With simple queries, using basic fields everything works fine - i get the data i want
ex. assets?query=[{“field” : “Catalog”, “value” : “3”},{“field” : “id”, “value” : “183”}]
A piece of json structure for CustomFields:
“CustomFields” : [
{
“name” : “Customer”,
“values” : [],
“type” : “customfield”,
“id” : “35”,
“_url” : “/REST/2.0/customfield/35”
},
{
“name” : “Next Renewal”,
“values” : [
“2022-02-02”
],
“type” : “customfield”,
“id” : “67”,
“_url” : “/REST/2.0/customfield/67”
}]
So i thought that a valid query should look like this:
domain.name/REST/2.0/assets?query=[{“field” : “Catalog”, “value” : “3”},{“field” : “CustomFields”, “value” : [{“field”: “name”, “value”:“Next Renewal”}, {“field”: “values”, “value”: “2022-02-02”}], “entry_aggregator”: “AND”}]
i have also tried:
domain.name/REST/2.0/assets?query=[{“field” : “Catalog”, “value” : “3”},{“field” : “CustomFields”, “value” : [{“field”: “Next Renewal”, “value”:“2022-02-02”}], “entry_aggregator”: “AND”}]
and this:
domain.name/REST/2.0/assets?query=[{“field” : “Catalog”, “value” : “3”},{“field”: “CustomFields”, “value”: [{“name” : “Next Renewal”, “values” : [“2022-02-02”]}], “entry_aggregator”: “AND”}]
but this does not work. The query (in both cases) returns all values valid for the first argument (Catalog=3), but it doesn’t include the filter Next Renewal=“2022-02-02” .
What am I missing here? Any ideas? Thanks in advance for your help.
Best Regards