class Github::Issues
def assignees(options={}, &block)
def assignees(options={}, &block) @assignees ||= ApiFactory.new('Issues::Assignees', current_options.merge(options), &block) end
def comments(options={}, &block)
def comments(options={}, &block) @comments ||= ApiFactory.new('Issues::Comments', current_options.merge(options), &block) end
def create(user_name, repo_name, params={})
]
"Label2"
"Label1",
"labels" => [
"milestone" => 1,
"assignee" => "octocat",
"body" => "I'm having a problem with this.",
"title" => "Found a bug",
github.issues.create
github = Github.new :user => 'user-name', :repo => 'repo-name'
= Examples
:labels - Optional array of strings - Labels to associate with this issue
:milestone - Optional number - Milestone to associate this issue with
:assignee - Optional string - Login for the user that this issue should be assigned to.
:body - Optional string
:title - Required string
= Inputs
Create an issue
def create(user_name, repo_name, params={}) set :user => user_name, :repo => repo_name assert_presence_of user, repo normalize! params # _merge_mime_type(:issue, params) filter! VALID_ISSUE_PARAM_NAMES, params assert_required_keys(%w[ title ], params) post_request("/repos/#{user}/#{repo}/issues", params) end
def edit(user_name, repo_name, issue_id, params={})
]
"Label2"
"Label1",
"labels" => [
"milestone" => 1,
"assignee" => "octocat",
"body" => "I'm having a problem with this.",
"title" => "Found a bug",
github.issues.edit 'user-name', 'repo-name', 'issue-id'
github = Github.new
= Examples
:labels - Optional array of strings - Labels to associate with this issue. Pass one or more Labels to replace the set of Labels on this Issue. Send an empty array ([]) to clear all Labels from the Issue.
:milestone - Optional number - Milestone to associate this issue with
:state - Optional string - State of the issue:open or closed
:assignee - Optional string - Login for the user that this issue should be assigned to.
:body - Optional string
:title - Optional string
= Inputs
Edit an issue
def edit(user_name, repo_name, issue_id, params={}) set :user => user_name, :repo => repo_name assert_presence_of user, repo, issue_id normalize! params # _merge_mime_type(:issue, params) filter! VALID_ISSUE_PARAM_NAMES, params patch_request("/repos/#{user}/#{repo}/issues/#{issue_id}", params) end
def events(options={}, &block)
def events(options={}, &block) @events ||= ApiFactory.new('Issues::Events', current_options.merge(options), &block) end
def get(user_name, repo_name, issue_id, params={})
github.issues.get 'user-name', 'repo-name', 'issue-id'
github = Github.new
= Examples
Get a single issue
def get(user_name, repo_name, issue_id, params={}) set :user => user_name, :repo => repo_name assert_presence_of user, repo, issue_id normalize! params # _merge_mime_type(:issue, params) get_request("/repos/#{user}/#{repo}/issues/#{issue_id}", params) end
def labels(options={}, &block)
def labels(options={}, &block) @labels ||= ApiFactory.new('Issues::Labels', current_options.merge(options), &block) end
def list(*args)
:direction => 'asc'
:sort => 'comments',
:labels => "bug,ui,bla",
:mentioned => 'octocat',
:assignee => '*',
:state => 'open',
github.issues.list_repo :milestone => 1,
github = Github.new :user => 'user-name', :repo => 'repo-name'
:direction => 'asc'
:sort => 'comments',
:labels => "bug,ui,bla",
:state => 'open',
:filter => 'created',
github.issues.list :since => '2011-04-12T12:12:12Z',
github = Github.new :oauth_token => '...'
= Examples
format: YYYY-MM-DDTHH:MM:SSZ
:since - Optional string of a timestamp in ISO 8601
:direction - asc, desc, default: desc
default: created
:sort - created, updated, comments,
:mentioned String User login
* * for Issues with any assigned User.
* none for Issues with no assigned User.
* String User login
:assignee
Example: bug,ui,@high
:labels - String list of comma separated Label names.
:state - open, closed, default: open
* * for Issues with any Milestone
* none for Issues with no Milestone.
* Integer Milestone number
:milestone
* all All issues the user can see
* subscribed Issues you've subscribed to updates for
* mentioned Issues mentioning you
* created Issues created by you
* assigned Issues assigned to you (default)
:filter
= Parameters
github.issues.list :user => 'user-name', :repo => 'repo-name'
github = Github.new
= Example
List issues for a repository
github.issues.list :org => 'org-name'
github = Github.new :oauth_token => '...'
= Example
List all issues for a given organization for the authenticated user.
github.issues.list :user
github = Github.new :oauth_token => '...'
= Example
authenticated user.
List all issues across owned and member repositories for the
github.issues.list
github = Github.new :oauth_token => '...'
= Example
and organization repositories.
including owned repositories, member repositories,
List all issues across all the authenticated user’s visible repositories
List your issues
def list(*args) params = args.extract_options! normalize! params # filter! VALID_ISSUE_PARAM_NAMES, params # _merge_mime_type(:issue, params) # assert_valid_values(VALID_ISSUE_PARAM_VALUES, params) response = if (org = params.delete('org')) get_request("/orgs/#{org}/issues", params) elsif (user_name = params.delete('user')) && (repo_name = params.delete('repo')) list_repo user_name, repo_name, params elsif args.include? :user get_request("/user/issues", params) else get_request("/issues", params) end return response unless block_given? response.each { |el| yield el } end
def list_repo(user_name, repo_name, params)
List issues for a repository
def list_repo(user_name, repo_name, params) set :user => user_name, :repo => repo_name assert_presence_of user, repo filter! VALID_ISSUE_PARAM_NAMES, params assert_valid_values(VALID_ISSUE_PARAM_VALUES, params) get_request("/repos/#{user}/#{repo}/issues", params) end
def milestones(options={}, &block)
def milestones(options={}, &block) @milestones ||= ApiFactory.new('Issues::Milestones', current_options.merge(options), &block) end