Created
May 6, 2014 08:32
-
-
Save datenimperator/b7f703b3000fde24c2e3 to your computer and use it in GitHub Desktop.
Display active, assigned tickets from Gitlab using Ruby
This file contains 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
#!/usr/bin/env ruby | |
require 'open-uri' | |
require 'json' | |
GITLAB='http://your.gitlabhost.com' | |
TOKEN='security_token' | |
USERNAME='your_username' | |
issues = JSON.load(open("#{GITLAB}/api/v3/issues?private_token=#{TOKEN}")) | |
issues | |
.reject{|i| i['state']=='closed'} | |
.reject{|i| i['assignee'].nil? || i['assignee']['username']!=USERNAME} | |
.group_by{|i| i['project_id'].to_i } | |
.each do |group| | |
project = JSON.load(open("#{GITLAB}/api/v3/projects/#{group[0]}?private_token=#{TOKEN}")) | |
puts project['name_with_namespace'] | |
group[1].each do |issue| | |
puts " #{issue['id']}: #{issue['title']}" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment