Recently I mentioned the github API and retrieving issues from it. This is because the joind.in project agreed to move its issue tracking from github to JIRA, since the issue tracker on github is far from feature complete. I migrated only our open issues, and comments (and the comments ended up a bit weirdly formatted on the other end but this was the best they could do). It was nothing pretty or clever but in case it's useful to someone else, here's the script:
$request = new HTTPRequest('http://github.com/api/v2/json/issues/list/joindin/joind.in/open');
$data = json_decode(file_get_contents('http://github.com/api/v2/json/issues/list/joindin/joind.in/open'));
$fp = fopen('joindin-issues.csv', 'w');
$titles = array('Summary', 'Reporter', 'DateCreated', 'Status', 'Description');
fputcsv($fp, $titles);
foreach($data->issues as $row) {
$output = array();
$comments = array();
$output[] = $row->title;
$output[] = $row->user;
$output[] = $row->created_at;
$output[] = 'Open';
$output[] = $row->body;
// handle comments
if($row->comments > 0) {
$comments = json_decode(file_get_contents('http://github.com/api/v2/json/issues/comments/joindin/joind.in/' . $row->number));
foreach($comments->comments as $comment_row) {
$created = strtotime($comment_row->created_at);
$output[] = 'Comment:'
. $comment_row->user . ':'
. date('m/d/y H:i:s A', $created) .':'
. $comment_row->body;
}
}
// write the line
fputcsv($fp, $output);
}
fclose($fp);
We moved to hosted JIRA studio and the only way to import to that is to email the CSV to the support team. I found that they were responsive within a few hours, and very polite and helpful.