Forums/Documentation/Searching the data in your Zendesk

Searching users, groups, and organizations

Anton de Young
posted this on June 30, 2011 11:12

Data in the user, group, and organization objects can be searched. Searching these objects returns user profiles and group and organization summary pages; each of which also lists any associated tickets.

You can search users, organizations, and groups by using the search tool that is displayed in the People page.

When you search from this page the results are restricted to this people data.

If you search using the global search tool, you need to also use thetypekeyword if you want to restrict results to specific types of data. If you don't, your search results will include matches from the data in your Zendesk.

type:organization tags:premium

The user data properties that can be searched are described in the tables below. All of the searchable data in your Zendesk (including ticket data) is described in Zendesk search reference.

The user and type keywords

To search for a user's profile data, you have the following two options.

Using theuserkeyword:
user:amy
Or, using thetype:userkeyword:
type:user amy
What's the difference between the two? The keyworduserwhen not combined withtypeis just a shortcut for finding users by ID, name, and email address. Theuserkeyword, like the ticket user role keywords (assignee, requester, submitter), accepts the ID, name, and email address as valid user identifiers.
user:52789480
user:amy
user:"amy moore"
user:amy@mondocam.com
If you want to search for additional user data, such as the user's phone number, the organization they belong to, and so on, you need to usetype:user.
type:user tags:beta_user organization:customers

This example also illustrates the usefulness oftypekeyword. With it you can search for user data that is shared by more than one user. You can search for users that are in the same organization or group or any of the other searchable user data. For more information about thetypekeyword, see Using the type keyword.

Thetypekeyword is also used to search the group and organization data objects.
type:group name:"level 2"
type:organization name:customers

Searching users

The user data object contains all of the user properties that you can set in the user profile. Not all of the user profile data is searchable; those properties that are searchable are described in the following table.

Note: You can't currently search for users by their role.
Table 1. User property keywords
KeywordDescription
name The user's partial or full name.
type:user name:"alex anderson"
email The user's email address.
type:user email:alex@mondocam.com

You can search for all users in an email domain. See Searching for users by email domain.

group The user's group name. This only applies to admin and agent users.
type:user group:"Level 2"
organization The user's organization name.
type:user organization:mondocam
created The date the user was added to your Zendesk.
type:user created<2011-05-01
notes All text in the notes field in the user's profile.
type:user notes:"manager"
details All text in the details field in the user's profile.
type:user details:"madison, wi"
external_id The user's external ID, if used.
type:user external_id:0098884412
phone The user's phone number. You must search for the number exactly as it was originally entered into the user's account.
type:user phone:555-111-2222
tags Tags that have been added to the user's profile.
type:user tags:premium tags:wholesale
For more information about tagging users and organizations, see Adding tags to users and organizations.

Searching for users by email domain

All users belonging to the same email domain can be returned with this search statement:
type:user mondocam.com
To search for more than one email domain at a time, you just add more email domains to the search:
type:user mondocam.com zendesk.com

Searching groups

Here are the group properties that can be searched.

Table 2. Group property keywords
KeywordDescription
name The group's name.
type:group name:"level 2"
created The date the group was added.
type:group created<2011-05-01

Searching organizations

Here are the organization properties that can be searched.

Table 3. Organization property keywords
KeywordDescription
name The user's partial or full name.
type:organization name:mondocam
created The date the organization was added.
type:organization created<2011-05-01
notes All text in the notes field in the user's profile.
type:organization notes:EMEA
details All text in the details field in the user's profile. type:user details:information
type:organization details:london
tags Tags that have been added to the organization.
type:organization tags:premium

For more information about tagging users and organizations, see Adding tags to users and organizations.

 

Comments

User photo
Tom Fennelly

Hi Anton.  Thanks for the article.  Is it possible to search users by "role" i.e. search for all users with the role of "Agent" or "Administrator" (or maybe user NOT "End-user")?

December 07, 2012 05:06
User photo
Tom Fennelly

I should clarify... I'm asking specifically about the possibility of doing this through the REST API.

December 07, 2012 05:13
User photo
Jay WS Chung

I want to add some comments on this. I used your "Zendesk API" page to test out some of REST API calls. I used "Search" method to search the users. However, it always returns all users. Is there any way I can search a user using "email" so I can update the user?

December 12, 2012 15:17
User photo
Justin Seymour
Zendesk
December 18, 2012 10:32
User photo
Jay WS Chung

Thanks for following up. Yap. I already figured it out. I had to use query=user_email.

December 18, 2012 10:35
User photo
Justin Seymour
Zendesk

Excellent, thanks! 

December 18, 2012 11:13
User photo
Jay WS Chung

I can't seem to search Organization / Group by 'name'. What is the syntax of it? I used same syntax as user search.

ex 1) groups.search({:query => "test"}).fetch / organizations.search({:query => "test"}).fetch

ex 1) groups.search({:name => "test"}).fetch / organizations.search({:name => "test"}).fetch

Both do not work. Is there any document that we can use it to figure it out this kind of syntax issue?

December 20, 2012 11:50
User photo
Justin Seymour
Zendesk

Where are you using that syntax? Are you utilizing the API? http://developer.zendesk.com/documentation/rest_api/search.html

See a full list of search keywords here: https://support.zendesk.com/entries/20239737-zendesk-search-reference

December 21, 2012 07:14