
In some cases you may have hundreds or even thousands of articles that you want Answer Bot to search, and only a few articles or sections that you explicitly don't want to use for Answer Bot. It can be very time consuming if you need to go through every single article to update it and add article labels. We've created a quick Ruby script to help you bulk update articles using the Zendesk Developer APIs.
We've created this script based on using a default install of MacOS, and we haven't tested it on every OS, using various versions of Ruby, etc. You'll need to do some of your own debugging and patching if this doesn't work for you. Read through the script before you run it - if you don't understand it then you shouldn't run it.
To use the bulk update script
- Download the Ruby script.
- Once the script is downloaded, open the script in a text editor.
- Replace the placeholder values with your subdomain, email address, and password.
- Open Terminal and navigate to the location where you downloaded the Ruby script; then run:
> ruby bulk_add_labels.rb - You'll be prompted to make a selection:
- Type 1 and hit Enter to provide a list of all your sections in your help center, along with their section ID.
- Type 2 and hit Enter to enter a section ID to bulk update all articles within that section.
After you enter the section ID you'll be prompted to enter the text for the label that you want to apply to all articles within that section. Enter your label text and hit Enter.
The script will loop through all articles and add the label - after every 7th article it'll sleep for 10 seconds to avoid hitting API rate limits.
- Type 3 and hit Enter to provide a list of comma-separated article IDs to bulk update.
After you enter the article IDs you'll be prompted to enter the text for the label that you want to apply to all articles within that section. Enter your label text and hit Enter.
The script will loop through all articles and add the label - after every 7th article it'll sleep for 10 seconds to avoid hitting API rate limits.
- Type 4 and hit Enter to exit the script.
Comments
0 comments
Please sign in to leave a comment.