Over a million developers have joined DZone.

Github API: Issues List

· Agile Zone

Learn more about how DevOps teams must adopt a more agile development process, working in parallel instead of waiting on other teams to finish their components or for resources to become available, brought to you in partnership with CA Technologies.

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!

Discover the warning signs of DevOps Dysfunction and learn how to get back on the right track, brought to you in partnership with CA Technologies.

Topics:

Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}