Skip to content

Instantly share code, notes, and snippets.

@niklas
Created August 8, 2012 11:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niklas/3294479 to your computer and use it in GitHub Desktop.
Save niklas/3294479 to your computer and use it in GitHub Desktop.
Migrate from pivotal tracker to kanbanery
#!/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