Page 1 of 1

API search on custom field and value

Posted: Tue Aug 20, 2024 12:24 pm
by cit
Hi,

We are using the API search functionality to get jobs where a custom field has a specific value. This has been working for at least a year, but seems to have stopped working over the last few days/week.

This is the query we are using:

/companies/0/jobs/?Stage=in(Complete,Archived)&CustomFields.CustomField.ID=35&CustomFields.Value=Yes&columns=ID

The combination of CustomFields.CustomField.ID=35&CustomFields.Value=Yes was suggested in a previous post here to get it working in the first place.

If I query a specific job that it should return I can see the custom field ID and value match the filter but it's not returned in the above query.

[
{
"ID": 65125,
"CustomFields": [
{
"CustomField": {
"ID": 35,
"Name": "Approved",
"Type": "List",
"IsMandatory": false,
"ListItems": [
"Yes",
"No",
"Sent"
]
},
"Value": "Yes"
}
]
}
]

Any idea why this is no longer working?

Thanks,
Duncan

Re: API search on custom field and value

Posted: Wed Aug 21, 2024 4:29 am
by SimproAPITeam
Hi Duncan,
We have identified an issue with the search when there are more than 30 custom fields on the project as an example.
Would this be the case in your instance?

Regards

Re: API search on custom field and value

Posted: Wed Aug 21, 2024 10:53 am
by cit
Hi,

Thanks for the suggestion. We have 21 custom fields in the "Leads, Quotes, Jobs & Recurring Custom Fields" section so that shouldn't be the issue for us.

Strangely it is working for some jobs, but not all. Is there a combination of custom field values that might impact it? We have several null values for instance, and various dates, lists, and text.

Thanks,
Duncan

Re: API search on custom field and value

Posted: Wed Aug 21, 2024 10:54 pm
by SimproAPITeam
Hi again,
I've recreated the test data that you mention and I was able to get the correct search results with the parameters you have included in your URL.

I would expect your query to work correctly. What results do you get, is it an empty array or an error message.

Double check your data and see how you go. If it's still not working send us a private message with your build details and specific examples of jobs you would expect in return and we can have a quick look.

Regards

Re: API search on custom field and value

Posted: Thu Aug 22, 2024 9:58 am
by cit
Thanks again for the reply. I've send a PM as requested.

Duncan

Re: API search on custom field and value

Posted: Tue Aug 27, 2024 12:38 am
by SimproAPITeam
Hi Duncan,
We have released an update that should solve the issues with custom fields. Please let us know if it's not working as expected for you.
Thank you!

Regards

Re: API search on custom field and value

Posted: Wed Jan 22, 2025 4:55 pm
by cit
Hi API team,

We're having this same issue again but I'm not certain when it started, possibly within the last few days. Can you check if the previous fix is still on our instance please?

Thanks,
Duncan