What is Trellinator?

Trellinator is an open source framework for automating Trello (and other things) using Google Apps Script (NB: since setting this up in Google Apps Script isn't always possible or ideal we can do the setup and hosting for you, you can check it out at BenkoBot).

Why is this a good idea?

Google Apps Script comes free with every Google account Google Apps Script is serverless and maintenance free Google Apps Script allows you to easily interact with all your other Google Services, and other products too via their APIs You can easily use Google Sheets to store information in a transparent way that you can interact with without having to learn any special database skills Google Apps Script is just JavaScript so there are millions of people who know how to write it, and it’s not hard to learn

Trellinator runs as a “bot”, a separate Trello account created just to automate commands in Trello. Trellinator code lives inside your Google Drive account and is owned entirely by you.

Trellinator is deployed as a script attached to a Google Sheet document, which is then deployed as a web application. This means that it can register a “webhook” with Trello boards, and react to events within Trello, for example when you set a due date it can schedule to remind you when the card is due.

A Note About Privacy

Even though Trellinator runs using a Trello account you control inside your own Google Drive account, there are 2 problems with using Google Apps Script to automate Trello that need to be solved with a “buffer” that sits in between Trello and Google Apps Script:

When you register a webhook with Trello, Trello sends a special web request called a “HEAD” request. Google Apps Script doesn’t know how to deal with this type of request and; Trello sends LOTS of notifications, and Google Apps Scripts deployed as web applications can only handle about 5 connections at a time

Therefore, a little “buffer” needs to sit in between Trello and Google Apps Script. By default, this sits on an AWS server owned by The Procedure People, but the code for it is open source and if you wanted to you could set up your own:

https://github.com/iaindooley/trellinator-buffer

The notifications are never stored permanently and in fact this is probably less of a privacy concern than almost all the other power ups and Google Chrome extensions you already use regularly but I thought I should mention it.

Hello World!

First, make sure you’re logged into your Google Drive account in a web browser and, in the same browser, login to a Trello account that you have set up just to be your Trellinator.

You don’t need a separate Google Account, you can set up a new Trello account using an alias of your existing Google account by just adding a “+” sign.

For example if I have a Google account team@benkoboard.com I can create a new Trello account using the email team+trellinator@benkoboard.com to run my Trellinator bot.

In this new Trello account, change the default “Untitled Board” to be named “Test Board” and then add your personal Trello account to the board.

Now open this template:

https://docs.google.com/spreadsheets/d/1-GfswT3E9szGl0vkCbFRvvirvicQ8ScUyncRoUCX3SM/edit#gid=0

Choose “File > Make a copy”. You can name the file whatever you like.

Now open the link in cell C2 of the Configuration sheet in a new browser tab and copy and paste your Trello API key back to cell B2 and hit enter to save this value.

Likewise, open the URL in cell C3 of the Configuration sheet in a new browser tab and authorise Trellinator, then copy and paste the token back to the cell B3 and hit enter.

Now choose “Tools > Script Editor”. Once the Script Editor opens choose “Publish > Deploy as web app”. Change the value of the “Who has access to the app:” dropdown to “Anyone, even anonymous” and then click the “Deploy” button. Click “Review Permissions” then allow access.

Switch back to the spreadsheet (but leave the Script Editor open in a new tab) and choose “Trellinator Utilities > Initialize”.

A bunch of sheets will be created, including one called “Test Board” (assuming you renamed the default “Untitled Board” to “Test Board” above).

Go to the “Test Board” sheet and put the value helloWorld into cell A2.

Now, logged into your personal Trello account, go to the Test Board, create a card and then post a comment on the card.

If everything is set up correctly, after a 4 - 5 seconds you will see a comment posted back by your Trellinator user that says “Hi! I'm Trellinator”.

Something more interesting

In order to really take this thing for a spin and give you a glimpse of the power of the platform, start by copying this code and pasting it into the end of the Commands.gs file in the Script Editor you opened earlier:

https://gist.github.com/iaindooley/5b4f7cbd3e3c4bfe7ad94a5e7abdb7cc

Now choose “Publish > Deploy as web app” again and change “Project version” to “New”, double check that the “Who has access to the app” dropdown is still set to “Anyone, even anonymous” and then click the “Update” button.

Now choose “Run > Run function > setup”. This will create two new boards in your Trellinator Trello account, one called Project Template and one called Projects Overview.

Using your Trellinator Trello account, add your personal Trello account to both of these boards.

You will also see 2 new sheets in your Trellinator spreadsheet. Open the sheet for “Projects Overview”, and enter the value createNewProjectBoard into cell A3.

Now go to the sheet called “Global Commands” and enter the following values into the cells indicated:

Enter the value “Project Boards” (without double quotes) into cells A2 and A3 Enter the value cardStarted into cell C2 Enter the value cardFinished into cell C3

Now, from your personal Trello account try creating a card in the “To Do” list of the “Projects Overview” board.

You will see a new board copied from the template, your personal Trello account will be added to it and a link to this board will be attached to the card you created in Projects Overview.

If you look in the Global Command Groups tab of the spreadsheet, you’ll see that this newly created board was added to the Project Boards group. This means it inherits the behaviour defined for Project Boards in the Global Commands sheet.

Now create a bunch of cards in the “To Do” list on your new project board. As you move each card to the “Doing” list, a comment will be added to the overview card indicating that work has started, and as you move each card to “Done” a comment is added indicating that work has finished on that card.

Removing Trellinator

If you want to safely remove Trellinator, all you need to do is revoke access to Trellinator from the Applications section of your Trellinator Trello account, then delete the Google sheet you created for it.

Learn more

This has just been a little taste of how Trellinator works. There’s lots more to learn, in particular how to run time triggered and recurring tasks, and how to create well tested code with proper version control.

You can find a much more comprehensive tutorial here:

http://docs.trellinator.com/trellinator_hello_world.pdf

And browse the complete documentation here:

http://docs.trellinator.com/

If you'd rather have someone else write the code and/or host your code, check out BenkoBot:

http://www.benkobot.com/

We also have a Trello board where you can leave ideas and comments, and see what’s planned:

https://trello.com/b/4SEU3lqj

And of course you can email team@benkoboard.com we’d love to hear from you.