Created
May 15, 2013 19:03
-
-
Save mironov/5586428 to your computer and use it in GitHub Desktop.
Import tasks from trello to kanbanery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "json" | |
require "csv" | |
json = File.read("qa.json") | |
parsed_json = JSON.parse(json) | |
lists = {} | |
parsed_json["lists"].each do |list| | |
lists[list["id"]] = list["name"] | |
end | |
tasks = [] | |
parsed_json["cards"].each do |card| | |
next if card["closed"] | |
title = card["name"] | |
type = "Feature" | |
description = card["url"] | |
description += "\n\n" + card["desc"] if card["desc"].to_s != "" | |
column = case lists[card["idList"]] | |
when "Icebox" | |
"Icebox" | |
when "Analysis" | |
"Analysis" | |
when "Development: To Do" | |
"To Do" | |
when "Development: Wait", "Development: In Progress" | |
"Programming" | |
when "Done" | |
"Done" | |
end | |
creator = "[email protected]" | |
tasks << [title, type, nil, nil, description, column, creator].to_csv | |
end | |
File.open("qa.csv", "w") do |file| | |
file.write tasks.reverse.join | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment