The other day I was browsing through Google's API documentation trying to figure out how to automatically create a spreadsheet to represent project health via Jira ticket priorities. On my last project I used to manually run filter for each feature to get the breakdown of Critical / Major / Minor issues, and then using a spreadsheet and color-coating I would make a heatmap of problem areas to help prioritize work.

Anyways, while digging through the Spreadsheet API, all I kept seeing were references to Java and .Net, and no great way to flex my JavaScript muscles. There was one reference that said:

The public visibility is useful for accessing the contents of a spreadsheet from the client context of a web page in JavaScript, for example.

I felt like I was hitting a dead end, because I wanted to create spreadsheets with JavaScript not make my private data public and just access it as read-only.

So I kept searching around for more JavaScript details and then I ended up back on the Apps Platform landing page. While there the following  caught my eye:

Google App Script promo - JavaScript cloud scripting platform with web-baesd IDE to automate tasks across Gmail, Docs, Charts, Maps and more.

What??! JavaScript? This sounded too good to be true.

I started reading through examples, and found that this in fact was a way to automate tasks with JavaScript. Having written CRON jobs before, this seemed very similar but waaaay more accessible. A CRON job is a command line script that you can run on a schedule. Typically setting the date is cryptic and complicated, plus you end up writing the script as a bash script, or CURL'ing an endpoint which is also a hassle.

Conceptually I see this as a web-based CRON where you can code with JavaScript, and makes it extremely simple to integrate with the Google platform.

For example, if I want to send an email, I simply write:

But the more I dug in, I found it's not just limited to Google API's. It's really not that hard to integrate other services as well. For example, the API documentation had an example which would grab XKCD's RSS feed and massage a change into the RSS feed. So, as a "hello world"  I re-purposed the example script to send me an email whenever a new comic comes out. The email contains the comic, and the comic's caption.

Sample email containing latest XKCD comic strip generated by App Script

The script looks like this:

After having this script setup for a couple weeks, I'm really happy with how it performs. I timed the interval so it arrives when I get to work, so I can read the latest comic as I sip my first coffee. I can see all sorts of applications for this. For example, I was able to connect to Jira and get information about bugs. I could take this info and turn it into a daily project status report, or make that heatmap I intended on building when I started this post ;)

Anyhow, the use-cases for this are endless, so go forth and hack and play! But remember, there are always limits (however they fairly reasonable ones).