Github API: Issues List

I’m deeply involved with an open source development project (joind.in, the event feedback site) and we recently made the decision to move our issue tracking away from GitHub (because it’s awful and meets none of the requirements for a bug tracker, but that’s a post for another day). In order to make this happen more smoothly, we wanted to migrate our open issues from github (to JIRA Studio, since Atlassian generously provides accounts here for worthy open source projects – thanks Atlassian!).

I looked around for some export functionality for github but I got a lot of posts complaining it wasn’t there. Since I hate applications that take your data and refuse to let you remove it, I was disappointed by this news but further inspection showed that although there might be no “export from github” button, there’s an API that more than has it covered. The API returns JSON which is easy to work with from many programming languages, and is perhaps even more powerful and flexible than the simple export I initially expected, so here are some examples.

(as a total aside, why isn’t there a thing to turn JSON into human-usable tabular form or similar? I just assumed there would be and googled for one but didn’t find it. Suggestions welcome, add a comment!)

I decided we only needed our currently open issues, and these were simple to retrieve: http://github.com/api/v2/json/issues/list/joindin/joind.in/open. Since I’m a PHP programmer, I just did this:

$data = json_decode(file_get_contents('http://github.com/api/v2/json/issues/list/joindin/joind.in/open'));

Each of the entries has a comments count too, so for those issues showing a comment count > 1 I grabbed those as well, using http://github.com/api/v2/json/issues/comments/joindin/joind.in/<issue number>

I’ll write a post about how we formatted the JIRA import once that has actually been done and shown to work – for now, if you want to get your data out of github, I hope this helps!

5 thoughts on “Github API: Issues List

  1. Jan: Ah that firefox plugin looks useful. I was wondering what a “normal” person would be able to do to retrieve their JSON data – thanks :)

    Victim: That’s a nice tool too, for scripters, thanks for your comment!

    • Sorry, I haven’t used the github API again since – although maybe I should look into it. I think the older APIs are still supported though, so perhaps you could try those?

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.