Recent searches


No recent searches

Export Agents as CSV

Completed


Posted May 31, 2019

UPDATE: Script method to do this is in the comments below.

---

ORIGINAL POST:

We often add groups of new agents and update existing ones, with various tags and other user options. An option to do so via bulk import/export CSV files would be amazing. Right now it's a messy combination of API calls and the bulk import option (https://support.zendesk.com/hc/en-us/articles/203661996-Bulk-importing-users-#topic_svw_jdl_dc) that doesn't have an equivalent export option so updating existing info is painful.

The User XML export option for this a bit overkill since I don't need our >100,000 end users' info - just the agents. For quickly updating a batch of users it takes too long to get the XML export (I'm still waiting on a report I requested >30 minutes ago). The format also doesn't match the CSV bulk import template.

It would also be great to have this available via a direct link as opposed to an emailed file.


7

15

15 comments

Hi Roman Sheydvasser,

I recommend using Zendesk Analytics (Insights) report for that.  You can create a simple report showing all the users (and filter out all end-users) along with their role (Agent, Administrator).  It's not showing the most up to date status - the data is downloaded only once a day, but that's enough for me.  

0


It took me a minute to figure out, but you need to have your metric as number of users, then you can have users as attribute and filter on user role. Number of users will be 1 for each entry. I was wasting time with tickets and submitter/assignee/requestor.

0


Hi @...,

Can you please confirm the steps for this

0


@...

Choose # Users in What, User Name and User Role in How and User Role isn't End-user in Filters.  Et voila! :)

Hope it helps!

0


@... Can you confirm those steps in Zendesk Explore instead of GoodData? 

0


Yes, Agreeing here. 

Hello Ewa, can you share the steps for Explore please? I'd be super grateful. 

 

0


image avatar

Sergey

Zendesk Customer Care

There is nothing like it in Explore, I am sorry to say. Explore returns data based on datasets and those datasets are connected to objects/events, so unless object exists or an event has occurred - no data will be returned. 
Explore can filter for user types, but only in regards to ticket requesters. If an agent has never been a requester of a ticket - you will not be able to get required data.

I would advise to use Search API to get the list of agents in JSON format (see here: https://developer.zendesk.com/rest_api/docs/support/search) and then you could utilise any tool available, that would convert JSON to CSV or Excel. There are plenty of free options available online.

Basic search query would look like this: subdomain.zendesk.com/api/v2/search.json?query=type:user%20role:agent

You can simply copy/paste it to your browser's address bar, adding your subdomain.

0


Just as a work around, I found using the Customer List in ZD was super easy to view and export all my agents according to Organizations. The only limitation is you are not able to tell if Chat is enabled on their profile. However, you can easily export, view last login in an excel file.

Hope this helps. 

regards 

0


Why can we not just have a simple "Export" button in the UI like so many other modern tools?  Come on Zendesk!  You can do better here!

4


HI Everyone,
 
Have any of you checked out the free Super Admin app in the Zendesk Apps Marketplace? I think it might be helpful here.

-2


@...

The Super Admin app does not help with large Zendesk deployments at all unfortunately. Per the reviews:

You can only see, change, and export a small handful of agents at one time, so it's not that helpful for organizations with large numbers of Zendesk agents.

Almost gets you there. We need to export a list of all out agents by the detailed role data, not just Agent/Admin/End User. The app only exports up to 100 agents, requiring 16 exports and merging of CSVs to get the desired output. Would be splendid if it supported a full export.

So it's only slightly better than the built in tooling. 
What we are asking for, is when the CEO asks for a list of all agents that are using paid seats/licenses, we can export that list without having to use workarounds that don't really work at all. I am still in awe that is not a simple built in option.

3


Thanks for clarifying, Brad, that's understandable & we appreciate your feedback.

-1


Agree with Brad

 

0


Python script to export agents into a CSV:

import requests, csv
from requests.auth import HTTPBasicAuth

url = 'https://YOUR_ZENDESK_SUBDOMAIN.zendesk.com/api/v2/search/export.json?query=role%3Aagent&filter[type]=user'
zd_auth = HTTPBasicAuth('ZENDESK_USER@YOUR_COMPANY.COM/token', 'YOUR_ZENDESK_API_TOKEN')
response = requests.get(url, auth = zd_auth)
data = response.json()
results = data['results']

# Open a file for writing and create csv writer
csv_file = open('users.csv', 'w')
csv_writer = csv.writer(csv_file)

# Write headers to the CSV file
header_line = results[0]
header = header_line.keys()
csv_writer.writerow(header)

for user in results:
    csv_writer.writerow(user.values())

while data['meta']['has_more']:
    url = data['links']['next']
    response = requests.get(url, auth = zd_auth)
    data = response.json()
    results = data['results']
    for user in results:
        csv_writer.writerow(user.values())

csv_file.close()

2


image avatar

Tom Dupuche

Zendesk Product Manager

Hi all,

Pleased to let you know we have added the ability to export team members / agents on the Team members page in Admin Center under the Actions button.

Regards,

Tom

Zendesk Product Manager

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post