News Archive
PhpRiot Newsletter
Your Email Address:

More information

Github To Jira Bug Migration Script

Note: This article was originally published at Planet PHP on 9 March 2011.
Planet PHP
Recently I mentioned the github API and retrieving issues from it. This is because the 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('');
$data = json_decode(file_get_contents(''));

$fp = fopen('joindin-issues.csv', 'w');
$titles = array('Summary', 'Reporter', 'DateCreated', 'Status', 'Description');
fputcsv($fp, $titles);

foreach($data-issues as $row) {
A A $output = array();
A A $comments = array();

A A $output[] = $row-title;
A A $output[] = $row-user;
A A $output[] = $row-created_at;

Truncated by Planet PHP, read more at the original (another 5113 bytes)