Created
January 26, 2012 20:03
-
-
Save ckozus/1684768 to your computer and use it in GitHub Desktop.
Listing non merged branches and getting unfuddle ticket status.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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