I’m trying to understand the behavior of the following endpoint -
GET /rest/api/3/user/search
The documentation describes the query param as following -
query
string
A query string that is matched against user attributes (
displayName
, andemailAddress
) to find relevant users. The string can match the prefix of the attribute’s value. For example, query=john matches a user with adisplayName
of John Smith and a user with anemailAddress
of johnson@example.com . Required, unlessaccountId
orproperty
is specified.
Can this endpoint be used to reliably find a user by email even though the email address may or may not be included in the response?
For example, GET /rest/api/3/user/search?query=user@domain.com
I was worried we may have an issue if a user with the displayName ‘user@gmail.com’ exists.
I tested this scenario by posting a user with this displayName and the user was not included when I queried using GET /rest/api/3/user/search?query=user@domain.com
.
Is the behavior of the query to only search by email if string is in an email format.
For example, GET /rest/api/3/user/search?query=domain.com
would include the user.
Let me know any further clarification is needed.