feature-requests icon indicating copy to clipboard operation
feature-requests copied to clipboard

Add feature to query user's custom fields

Open NguyenNamUET opened this issue 1 year ago • 3 comments

Rocketchat's user list API does not provide support for querying custom fields.

For example: I successfully added custom fields company and department in user's profile, but query { "customFields.company": {$eq: "Facebook"}, "customFields.company" {$eq: "Customer Support"}: } return error {"success":false,"error":"Invalid attribute: customFields.company [error-invalid-query]","errorType":"error-invalid-query"}

There's a workaround to get user by custom fields:

  • Get all users by API get user info to get user's custom fields
  • Perform filter in code (filter Javascript for example).

However, this approach invokes TOO MUCH calls to server whereas if user list API supports querying by custom fields, it only takes 1 request.

So I propose Rocketchat provide support for querying custom fields in user list API.

NguyenNamUET avatar Apr 14 '23 04:04 NguyenNamUET

Can i pick that one ?

thealoneshadow avatar Apr 16 '23 11:04 thealoneshadow

Can i pick that one ?

No need to ask for permission to fix the issue, feel free to work on it! Just check if someone it's already raised a PR for that (should be linked in this issue). Best of luck 🚀 👏


Questions? Help needed? Feature Requests?

hugocostadev avatar Apr 18 '23 13:04 hugocostadev

Thanks for your support Is it supported now?

NguyenNamUET avatar Dec 27 '23 10:12 NguyenNamUET