Skip to content

Instantly share code, notes, and snippets.

@ckozus
Created January 26, 2012 20:03
Show Gist options
  • Save ckozus/1684768 to your computer and use it in GitHub Desktop.
Save ckozus/1684768 to your computer and use it in GitHub Desktop.
Listing non merged branches and getting unfuddle ticket status.
subdomain = 'a17'
project_id = '36176' # krrb
username = 'ckozus'
password = 'secret'
tickets = `git branch -r --no-merged`
tickets.split("\n").each do |ticket_str|
if ticket_str =~ /ticket-(\d+)/
ticket_no = $1
output = `curl -s -L -u #{username}:#{password} -X GET -H 'Accept: application/xml' 'http://#{subdomain}.unfuddle.com/api/v1/projects/#{project_id}/tickets/by_number/#{ticket_no}.xml' | grep 'status'`
output =~ /<status>(.*)<\/status>/
status = $1
puts "Ticket: #{ticket_no} - #{status}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment