GitHub issues as CSV with Ruby and HTTParty

Recently we told you about our move to Kanban. To fill the backlog our project manager Nina needed a list of our current GitHub issues, ideally in a spreadsheet format. A couple lines of Ruby produce CSV output consisting of issue title, creation date, reporter and labels, which then can be redirected to a file and opened with any spreadsheet program.

require 'httparty'

class GitHubIssues
  include HTTParty
  base_uri ''
    # username must be of the form '/token:'
    opts = {:basic_auth => {:username => ''}}
    self.get('/issues/list///open', opts)["issues"].each do |issue|
      puts "#{issue["title"]};#{issue["created_at"]};#{issue["user"]};#{issue["labels"].join(',')}"

It’s quick and dirty (e.g. will die if there are no issues), but does exactly what we needed in just a couple of lines thanks to the awesome HTTParty.

Previous Post Next Post

You Might Also Like

No Comments

Leave a Reply