Tool to backup/restore triggers, automations, and macros
Hello there!
I just wanted to share with you all a little tool that I made using Google Spreadsheets to backup and restore automations, macros, and triggers. This comes in handy especially if you want to save up some costs by using other platforms.
This is not 100% automated in terms that you need to run the script manually every time you want to backup/restore something, but it helps a lot.
You can find the tool with its instructions in the following link:
https://github.com/juliofslt/Zendesk-restore-and-backup-tool
I know the code can be improved a little more to be shorter/more efficient, but I haven't had the time to do it. Either way, if you have any recommendations/advice, let me know!
Hope you find it useful! :)
-
Thanks for posting this tip, Julio!
-
This looks incredibly useful. I am trying it out and ran across a few things I think you should add. I will submit a pr on github. The backup seems to work great so far.
The only actual issue I ran into was using the RESTORE. But, that was my own negligence.
Great tip!
-
Hi @...!
I'll look into this and I'll get back to you about this issue on GitHub. Thanks a lot for the feedback!
-
I use this add-on to Google Sheets called API Connector:
https://mixedanalytics.com/api-connector/
Literally allows me to pull all the data from Zendesk into a nice spreadsheet. Click one button and the API call will run and update the data. Very very handy!
-
const response = JSON.parse(UrlFetchApp.fetch(`https://${subDomain}.zendesk.com/api/v2/dynamic_content/${token}.json`, options))
Which token needs to be added here?
-
Kulin Joshi You don't need to add any token there. In the WRITEDATA() function, you can see that the first thing to be declared/initialized is an array with 4 strings (triggers, automations, macros, items).
Later, there's a for loop that iterates over this array, and for each iteration, each of these items will be passed as an argument when we call the GETBACKUP() function, and this "token" will complete the URL to make the HTTP request.
Basically, it's what is going to allow you to make the request to the different API endpoints that are being used here to get the triggers, automations, macros, and dynamic content items.
Hope this helps!
-
Message detailsException: Request failed for https://tomtomhelp1570114826.zendesk.com returned code 401. Truncated server response: {"error":"Couldn't authenticate you"} (use muteHttpExceptions option to examine full response)I get above error
-
Kulin Joshi Check your authentication method. If your Zendesk is using 2FA, you won't be able to authenticate just with your email and password. In this case, you would need to authenticate with an API key.
This happened to me and it's the reason the support guy at Zendesk told me.
Please sign in to leave a comment.
8 Comments