Skip to content

Commit

Permalink
gitlab issues export
Browse files Browse the repository at this point in the history
  • Loading branch information
vitek-rostislav committed Oct 20, 2016
0 parents commit 21c4674
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issues.csv
nbproject/*
setting.xml
19 changes: 19 additions & 0 deletions gitlab-issues-export.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
$xml = simplexml_load_file('setting.xml');
$token = $xml->token;
$ch = curl_init('http://gitlab/api/v3/projects/34/issues?milestone=New%20infrastructure&private_token=' . $token . '&per_page=100');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
$issues = json_decode($output, true);
$file = fopen('issues.csv', 'w');
fputcsv($file, ['Název', 'Přiřazeno k', 'Stav']);
foreach ($issues as $issue) {
$data = [
$issue['title'],
$issue['assignee']['name'],
$issue['state'],
];
fputcsv($file, $data);
}
fclose($file);
curl_close($ch);

0 comments on commit 21c4674

Please sign in to comment.