Skip to content

Instantly share code, notes, and snippets.

@deplorableword
Created February 1, 2011 10:43
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 deplorableword/805690 to your computer and use it in GitHub Desktop.
Save deplorableword/805690 to your computer and use it in GitHub Desktop.
sudo gem install ticketmaster, sudo gem install ticketmaster-lighthouse. usage: ruby lighthoust-export.rb accoutname username password projectid
require 'rubygems'
require 'ticketmaster'
require 'ticketmaster-lighthouse'
Lighthouse.account = ARGV[0]
Lighthouse.authenticate(ARGV[1],ARGV[2])
all_tickets = Lighthouse::Ticket.find(:all, :params => { :project_id => ARGV[3] })
begin
File.delete("export.csv")
rescue
end
export = File.new("export.csv", "w+")
export.puts("'id,'title','description'")
all_tickets.each do |ticket|
export.puts('#'+ticket.id.to_s+','+ticket.title+',')
if (ticket.original_body != nil)
export.puts(ticket.original_body+'')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment