Sha256: 0948bfa87ad465b0beab9518cf26bc4a965d9561232cf6dce33848bcfa4b7274

Contents?: true

Size: 900 Bytes

Versions: 14

Compression:

Stored size: 900 Bytes

Contents

require 'rubygems'
require 'ticketmaster'
require 'ticketmaster-pivotal'
require 'ticketmaster-lighthouse'

# copy all tickets and comments from pivotal tracker to new lighthouse project
puts "Copy started..."
pivotal = TicketMaster.new(:pivotal)
pivotal_project = pivotal.project(97107)
lighthouse = TicketMaster.new(:lighthouse)
puts "Creating new project in Lighthouse..."
lighthouse_project = lighthouse.project!(:name => "Copy Test on #{Time.now}", :description => "A copy test")

pivotal_project.tickets.each do |pivotal_ticket|
  puts "Copying ticket '#{pivotal_ticket.title}'..."
  
  lighthouse_ticket = lighthouse_project.ticket!({:title => pivotal_ticket.title, 
                                                  :description => pivotal_ticket.description})
  pivotal_ticket.comments.each do |comment|
    lighthouse_ticket.comment!(:body => comment.body)
  end
end
puts "Copy finished."

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ticketmaster-0.5.2 examples/tm_example_3.rb
ticketmaster-0.5.1 examples/tm_example_3.rb
ticketmaster-0.5.0 examples/tm_example_3.rb
ticketmaster-0.4.9 examples/tm_example_3.rb
ticketmaster-0.4.8 examples/tm_example_3.rb
ticketmaster-0.4.7 examples/tm_example_3.rb
ticketmaster-0.4.6 examples/tm_example_3.rb
ticketmaster-0.4.5 examples/tm_example_3.rb
ticketmaster-0.4.3 examples/tm_example_3.rb
ticketmaster-0.4.2 examples/tm_example_3.rb
ticketmaster-0.4.1 examples/tm_example_3.rb
ticketmaster-0.4.0 examples/tm_example_3.rb
ticketmaster-0.3.10 examples/tm_example_3.rb
ticketmaster-0.3.9 examples/tm_example_3.rb