Export Agents as CSV

14 Comments

  • Ewa Kondratowicz

    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
  • John Witt

    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
  • Andrew Lee

    Hi @...,

    Can you please confirm the steps for this

    0
  • Ewa Kondratowicz

    @...

    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
  • Amy Ng

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

    0
  • Kelsa Henry

    Yes, Agreeing here. 

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

     

    0
  • 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
  • Kelsa Henry

    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
  • Anthony Del Campo

    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!

    3
  • Dave Dyson
    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
  • BradAtStash

    @...

    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
  • Dave Dyson
    Thanks for clarifying, Brad, that's understandable & we appreciate your feedback.
    -1
  • Cameron Greenfield

    Agree with Brad

     

    0
  • Roman Sheydvasser

    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

Please sign in to leave a comment.

Powered by Zendesk