问题
Background:
I've written a backup tool for the Mercurial/Git hoster Bitbucket, which asks for a username, gets a list of the user's repositories via the Bitbucket API, and clones each of them to the local machine.
Each Bitbucket repository has an issue tracker, and now I've got a new feature request: backup the issues as well.
I can actually get the issues in JSON format from the Bitbucket API.
Here is an example: https://api.bitbucket.org/1.0/repositories/christianspecht/bitbucket-backup/issues/
But how to backup this to the local machine?
I could just save the JSON in a text file, but I don't think you can do anything useful with a list of issues in JSON format.
Is there such a thing like a standard file format for bugs/issues?
In a perfect world, maybe anything that the most widespread issue tracking systems are able to import?
回答1:
I suspect the answer is No, there's no standard. Here are some options:
Bugzilla:
Bugzilla can import/export both CSV and XML:
Here's this search: https://bugzilla.mozilla.org/buglist.cgi?quicksearch=css3+text exported to CSV and XML and here's this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=156881 exported to XML.
JIRA:
JIRA can import from Pivotal Tracker, Bugzilla, FogBugz, Mantis, Trac and more, apparently, and can export as XML and CSV.
Here's this bug: https://jira.atlassian.com/browse/WBS-49 exported as XML and this search: https://jira.atlassian.com/browse/GHS-5597?jql=text~%22greenhopper%20api%20plugin%22 exported as XML - you can also export these as .xls files.
Roundup
The roundup-admin CLI has a sub command export which can be used to create a bunch of .csv files together with sub directories containing the messages and file attachments. See http://roundup.sourceforge.net/docs/admin_guide.html#migrating-backends for how this can be used to migrate the issue data to another database.
TRAC
Trac can export to CSV & TSV. Here's this search: http://trac.edgewall.org/report/2 exported to CSV and this bug: http://trac.edgewall.org/ticket/886 exported to CSV and TSV.
来源:https://stackoverflow.com/questions/12205108/is-there-a-standard-file-format-for-exporting-issues-from-an-issue-tracker