Can you export macros into a csv or word doc? | Community
Skip to main content

Can you export macros into a csv or word doc?

  • June 27, 2014
  • 4 replies
  • 0 views

I'm trying to do an audit of all of our macros. It would be easiest if I could export them all into a csv or word file. Then make global edits (to make sure we're consistent). From there I am happy to copy and paste into exiting macros. Or reimport the data. Is this doable?

This topic has been closed for replies.

4 replies

  • June 27, 2014

Shari,

This is possible to do via API - http://developer.zendesk.com/documentation/rest_api/macros.html

https://yourzendesksite.zendesk.com/api/v2/macros.json - using Pretty json or something similar in chrome really helps view this.

How many macros are you looking at copying?

Hope this helps,

McCabe


  • September 26, 2016

Hi there.

I have the same request - but no clue about API or whatsoever.

So, it would be extremely usefull if there would be a "Export to .doc" feature.

I guess its not that much of programming but as I said I have no clue.

Maybe someone thinks over that issue. Would ease up things a lot - 

aha - I am talking about over 175 written comment macros - too much to copy and paste.

Thanks a lot.


Nicole17
  • January 10, 2018

Moderator Vladan wrote a tip on how to export macros into an excel sheet. It gives the instructions on how to access this information via the API. 


  • January 7, 2019

Was not finding it at all, I created a bashscript to do this:

100% working, 100% stupid.. but I had no time to do this

$ cat desk.sh

 

#!/bin/bash
user='email'
passwd='passwd'

# how many entries to create

#this could get how many entries json have with something like ( cat file.json | grep title | wc -l )
howmany=90

#get macros from zendesk user

#this will not get page 2 /3 etc.. need to be updated to do this
#nciphermacros=$(curl https://{GET_FROM_HERE}.zendesk.com/api/v2/macros/active.json -v -u $user:$passwd)

 

# get only user's personal macros and just useful information
#mymacros=$(echo $nciphermacros | jq '.macros[] | select(.restriction.type == "User") | {title: .title , active: .active , actions: .actions , restriction: .restriction}')

# get only non personal user macros
#mymacros=$(echo $nciphermacros | jq '.macros[] | select(.restriction.type != "User") | {title: .title , active: .active , actions: .actions , restriction: .restriction}')

for((i=0; i <= $howmany ; ++i)) do

#this will post 1 macro at a time 

echo $mymacros | jq -s ".[$i]" | xargs -0 -I DATA curl -X POST -H "Content-Type: application/json" -d '{"macro": DATA }' -u $user:$passwd "https://{POST_TO_HERE}.zendesk.com/api/v2/macros.json"

done