Project

General

Profile

Custom field filter for user records via the REST API?

Added by Paul Philion 9 days ago

The /issues endpoint in the REST API provides a optional filter for custom fields:

cf_x: get issues with the given value for custom field with an ID of x

The /users endpoint does not have the same filter, and the name filter doesn't include custom fields.

Is there any other way to select users based on custom fields via the API?

I'm limping my way thru caching all users indexed by custom field, just for that lookup.


Replies (2)

RE: Custom field filter for user records via the REST API? - Added by Ruby Williams 5 days ago

Hello!
The /users endpoint doesn't support filtering by custom fields. Your best bet is to continue caching users by custom fields for lookups. Alternatively, you can fetch all users and filter them locally or use custom scripts to maintain a cache.

Regards

RE: Custom field filter for user records via the REST API? - Added by Holger Just 4 days ago

The /users endpoint actually supports more specific filters since 3.1.0 resp. #37674, including filtering by user custom fields. As such, you should be able to filter users by their custom field values similarly to how the issues filters work.

    (1-2/2)