Created
August 8, 2012 11:49
-
-
Save niklas/3294479 to your computer and use it in GitHub Desktop.
Migrate from pivotal tracker to kanbanery
This file contains 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
#!/usr/bin/env ruby | |
# Converts PivotalTracker's (PT) export CSV in a CSV kanbanery (KB) accepts to import. | |
# | |
# Features: | |
# * maps PT's states to KB's columns, see $mapper | |
# * story types are converted | |
# | |
# Bugs: | |
# * comments are not imported | |
# * priority is fixed to 1 | |
# * creator_email cannot be set | |
# * creator (in KB) will always be the admin doing the import | |
require 'csv' | |
pt = CSV.new STDIN, { headers: true, | |
converters: :numeric, | |
header_converters: :symbol } | |
# Board type: "Software Project" | |
$mapper = { | |
'accepted' => 'Done', | |
'unscheduled' => 'Icebox', | |
'rejected' => 'Coding', | |
'delivered' => 'Approval', | |
'started' => 'Coding', | |
'finished' => 'Testing', | |
'unstarted' => 'Backlog' | |
} | |
def column_for(column_name) | |
$mapper[column_name] || column_name | |
end | |
kanban = CSV.generate do |csv| | |
# %w(title type estimate priority description column_name creator_email) | |
pt.read.each do |t| | |
csv << [ | |
t[:story], | |
t[:story_type], | |
t[:estimate], | |
1, # priority | |
t[:description], | |
column_for( t[:current_state] ), # column_name | |
t[:owned_by] | |
] | |
end | |
end | |
STDOUT.puts kanban.to_s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment