REST2 - searching by customfield values

I am developing a web service which helps with automation of certain tasks in RT in our organization. For one particular task it is absolutely necessary to be able to search assets by their custom field values. Question is - how do I form a request to do that? I can search by, for example, name, submitting a POST request to https://our-rt/REST/2.0/assets with body of
[
{‘field’: ‘Name’,
‘operator’: ‘=’,
‘value’: ‘Some name’}
]
But so far, I haven’t been able to figure out the syntax for customfield values. The documentation is silent on the subject. Is it even possible to do that?

Hi malorin,

The last time I asked BestPractical about this they told me that searching customfields would require integration between AssetSQL and the REST2 api. Doing this work was on their radar but ‘there is a lot of competition’.

Based on your report and my limited testing today I suspect that the work required to hook into AssetSQL via REST2 never happened.

It is unfortunate that the documentation doesn’t mention that searching Asset customfields is not possible via the api.

If your org is willing to pay for the feature to be added then BestPractical will definitely work with you on that. Let me know if you consider paying for the work to be done. My org might be able to help cover some of the costs since this is a feature we’re also waiting/hoping for.

-Josh

Hello, Josh.

Well, that’s sad to hear. It’s kinda weird that REST2 doesn’t have AssetSQL integration by default, but I guess that has something to do with Assets being an addon long time ago, before becoming a built-in feature. Guess I’ll have to resort to GETting the results from web and parsing them somehow, as I have high amounts of doubt that my org would finance that endeavour to that degree :frowning: