0

I am trying to find the best way to import all of our Lighthouse data (which I exported as JSON) into JIRA, which wants a CSV file.

I have a main folder containing many subdirectories, JSON files and attachments. The total size is around 50MB. JIRA allows importing CSV data so I was thinking of trying to convert the JSON data to CSV, but all convertors I have seen online will only do a file, rather than parsing recursively through an entire folder structure, nicely creating the CSV equivalent which can then be imported into JIRA.

Does anybody have any experience of doing this, or any recommendations?

Thanks, Jon

4

2 回答 2

0

JIRA CSV 导入器假定每个问题的非规范化视图,每个问题的所有字段都在一行中。我认为最快的方法是编写一个小的 Python 脚本来读取 JSON 并发出最小的 CSV。这应该会给你带来问题和评论。跟踪与每个新问题键对应的 Lighthouse ID。然后编写另一个脚本以使用 JIRA SOAP API 添加附件等内容。对于 JIRA 5.0,REST API 是更好的选择。

于 2012-01-23T21:29:02.763 回答
0

我们刚刚经历了从 Lighthouse 到 JIRA 的迁移并遇到了这个问题。最好的办法是在您的脚本中,从顶级导出目录开始并遍历每个 ticket.json 文件。然后,您可以构建一个主 CSV 或 JSON 文件以导入到包含所有票证的 JIRA。

在 Ruby(这是我们使用的)中,它看起来像这样:

Dir.glob("path/to/lighthouse_export/tickets/*/ticket.json") do |ticket|
  JSON.parse(File.open(ticket).read).each do |data|
    # access ticket data and add it to a CSV
  end
end
于 2013-08-30T02:49:08.147 回答