Wrap text
Report abuse
save to bulkedit.rb
if ARGV.size < 5
puts "ruby bulkedit.rb MYTOKEN MYACCOUNT MYPROJECT QUERY COMMAND [MIGRATION_TOKEN]"
puts
puts "example: ruby bulk edit.rb 1sdfasd23rfSDfasdf shake-and-bake 1 \"milestone:\\\"1.0 Launch\\\" state:open\" \"milestone:next\""
puts
puts "see also: http://help.lighthouseapp.com/faqs/ticket-workflow/ticket-keyword-updates"
puts "problems? http://help.lighthouseapp.com"
exit
end
token = ARGV.shift
account = ARGV.shift
project = ARGV.shift
params = {'query' => ARGV.shift, 'command' => ARGV.shift, 'migration_token' => ARGV.shift}
lh_domain = ENV['LH_DOMAIN'] || "lighthouseapp.com"
require 'net/http'
require 'uri'
res = Net::HTTP.post_form URI.parse("http://#{token}:x@#{account}.#{lh_domain}/projects/#{project}/bulk_edit.json"), params
if res.body == ' '
puts "Done!"
else
puts res.body
end