Module: Octokit::Client::Issues
| Relationships & Source Files | |
| Extension / Inclusion / Inheritance Descendants | |
| Included In: | |
| Defined in: | lib/octokit/client/issues.rb | 
Overview
Methods for the Issues API
Instance Method Summary
- 
    
      #add_assignees(repo, number, assignees, options = {})  ⇒ Sawyer::Resource 
    
    Add assignees to an issue. 
- 
    
      #add_comment(repo, number, comment, options = {})  ⇒ Sawyer::Resource 
    
    Add a comment to an issue. 
- 
    
      #close_issue(repo, number, options = {})  ⇒ Sawyer::Resource 
    
    Close an issue. 
- 
    
      #create_issue(repo, title, body = nil, options = {})  ⇒ Sawyer::Resource 
      (also: #open_issue)
    
    Create an issue for a repository. 
- 
    
      #delete_comment(repo, number, options = {})  ⇒ Boolean 
    
    Delete a single comment. 
- 
    
      #issue(repo, number, options = {})  ⇒ Sawyer::Resource 
    
    Get a single issue from a repository. 
- 
    
      #issue_comment(repo, number, options = {})  ⇒ Sawyer::Resource 
    
    Get a single comment attached to an issue. 
- 
    
      #issue_comments(repo, number, options = {})  ⇒ Array<Sawyer::Resource> 
    
    Get all comments attached to an issue. 
- 
    
      #issue_timeline(repo, number, options = {})  ⇒ Sawyer::Resource 
    
    Get the timeline for an issue. 
- 
    
      #issues(repository = nil, options = {})  
    
    Alias for #list_issues. 
- 
    
      #issues_comments(repo, options = {})  ⇒ Array<Sawyer::Resource> 
    
    Get all comments attached to issues for the repository. 
- 
    
      #list_assignees(repo, options = {})  ⇒ Array<Sawyer::Resource> 
    
    Lists the available assignees for issues in a repository. 
- 
    
      #list_issues(repository = nil, options = {})  ⇒ Array<Sawyer::Resource> 
      (also: #issues)
    
    List issues for the authenticated user or repository. 
- 
    
      #lock_issue(repo, number, options = {})  ⇒ Boolean 
    
    Lock an issue's conversation, limiting it to collaborators. 
- 
    
      #open_issue(repo, title, body = nil, options = {})  
    
    Alias for #create_issue. 
- 
    
      #org_issues(org, options = {})  ⇒ Array<Sawyer::Resource> 
    
    List all issues for a given organization for the authenticated user. 
- 
    
      #remove_assignees(repo, number, assignees, options = {})  ⇒ Sawyer::Resource 
    
    Remove assignees from an issue. 
- 
    
      #reopen_issue(repo, number, options = {})  ⇒ Sawyer::Resource 
    
    Reopen an issue. 
- 
    
      #unlock_issue(repo, number, options = {})  ⇒ Boolean 
    
    Unlock an issue's conversation, opening it to all viewers. 
- 
    
      #update_comment(repo, number, comment, options = {})  ⇒ Sawyer::Resource 
    
    Update a single comment on an issue. 
- 
    
      #update_issue(repo, number, title, body, options)  ⇒ Sawyer::Resource 
    
    Update an issue. 
- 
    
      #user_issues(options = {})  ⇒ Array<Sawyer::Resource> 
    
    List all issues across owned and member repositories for the authenticated user. 
Instance Method Details
    #add_assignees(repo, number, assignees, options = {})  ⇒ Sawyer::Resource 
  
Add assignees to an issue
# File 'lib/octokit/client/issues.rb', line 345
def add_assignees(repo, number, assignees, = {}) post "#{Repository.path repo}/issues/#{number}/assignees", .merge({ assignees: assignees }) end
    #add_comment(repo, number, comment, options = {})  ⇒ Sawyer::Resource 
  
Add a comment to an issue
# File 'lib/octokit/client/issues.rb', line 283
def add_comment(repo, number, comment, = {}) post "#{Repository.path repo}/issues/#{number}/comments", .merge({ body: comment }) end
    #close_issue(repo, number, options = {})  ⇒ Sawyer::Resource 
  
Close an issue
# File 'lib/octokit/client/issues.rb', line 131
def close_issue(repo, number, = {}) patch "#{Repository.path repo}/issues/#{number}", .merge({ state: 'closed' }) end
    #create_issue(repo, title, body = nil, options = {})  ⇒ Sawyer::Resource 
    Also known as: #open_issue
  
Create an issue for a repository
# File 'lib/octokit/client/issues.rb', line 91
def create_issue(repo, title, body = nil, = {}) [:labels] = case [:labels] when String [:labels].split(',').map(&:strip) when Array [:labels] else [] end parameters = { title: title } parameters[:body] = body unless body.nil? post "#{Repository.path repo}/issues", .merge(parameters) end
    #delete_comment(repo, number, options = {})  ⇒ Boolean 
  
Delete a single comment
# File 'lib/octokit/client/issues.rb', line 308
def delete_comment(repo, number, = {}) boolean_from_response :delete, "#{Repository.path repo}/issues/comments/#{number}", end
    #issue(repo, number, options = {})  ⇒ Sawyer::Resource 
  
Get a single issue from a repository
# File 'lib/octokit/client/issues.rb', line 114
def issue(repo, number, = {}) get "#{Repository.path repo}/issues/#{number}", end
    #issue_comment(repo, number, options = {})  ⇒ Sawyer::Resource 
  
Get a single comment attached to an issue
# File 'lib/octokit/client/issues.rb', line 270
def issue_comment(repo, number, = {}) paginate "#{Repository.path repo}/issues/comments/#{number}", end
    #issue_comments(repo, number, options = {})  ⇒ Array<Sawyer::Resource> 
  
Get all comments attached to an issue
# File 'lib/octokit/client/issues.rb', line 258
def issue_comments(repo, number, = {}) paginate "#{Repository.path repo}/issues/#{number}/comments", end
    #issue_timeline(repo, number, options = {})  ⇒ Sawyer::Resource 
  
Get the timeline for an issue
# File 'lib/octokit/client/issues.rb', line 320
def issue_timeline(repo, number, = {}) = ensure_api_media_type(:issue_timelines, ) paginate "#{Repository.path repo}/issues/#{number}/timeline", end
#issues(repository = nil, options = {})
Alias for #list_issues.
# File 'lib/octokit/client/issues.rb', line 34
alias issues list_issues
    #issues_comments(repo, options = {})  ⇒ Array<Sawyer::Resource> 
  
Get all comments attached to issues for the repository
By default, Issue Comments are ordered by ascending ID.
# File 'lib/octokit/client/issues.rb', line 246
def issues_comments(repo, = {}) paginate "#{Repository.path repo}/issues/comments", end
    #list_assignees(repo, options = {})  ⇒ Array<Sawyer::Resource> 
  
Lists the available assignees for issues in a repository.
# File 'lib/octokit/client/issues.rb', line 332
def list_assignees(repo, = {}) paginate "#{Repository.path repo}/assignees", end
    #list_issues(repository = nil, options = {})  ⇒ Array<Sawyer::Resource> 
    Also known as: #issues
  
List issues for the authenticated user or repository
# File 'lib/octokit/client/issues.rb', line 30
def list_issues(repository = nil, = {}) path = repository ? "#{Repository.new(repository).path}/issues" : 'issues' paginate path, end
    #lock_issue(repo, number, options = {})  ⇒ Boolean 
  
Lock an issue's conversation, limiting it to collaborators
# File 'lib/octokit/client/issues.rb', line 160
def lock_issue(repo, number, = {}) boolean_from_response :put, "#{Repository.path repo}/issues/#{number}/lock", end
#open_issue(repo, title, body = nil, options = {})
Alias for #create_issue.
# File 'lib/octokit/client/issues.rb', line 104
alias open_issue create_issue
    #org_issues(org, options = {})  ⇒ Array<Sawyer::Resource> 
  
List all issues for a given organization for the authenticated user
# File 'lib/octokit/client/issues.rb', line 73
def org_issues(org, = {}) paginate "#{Organization.path org}/issues", end
    #remove_assignees(repo, number, assignees, options = {})  ⇒ Sawyer::Resource 
  
Remove assignees from an issue
# File 'lib/octokit/client/issues.rb', line 363
def remove_assignees(repo, number, assignees, = {}) delete "#{Repository.path repo}/issues/#{number}/assignees", .merge({ assignees: assignees }) end
    #reopen_issue(repo, number, options = {})  ⇒ Sawyer::Resource 
  
Reopen an issue
# File 'lib/octokit/client/issues.rb', line 148
def reopen_issue(repo, number, = {}) patch "#{Repository.path repo}/issues/#{number}", .merge({ state: 'open' }) end
    #unlock_issue(repo, number, options = {})  ⇒ Boolean 
  
Unlock an issue's conversation, opening it to all viewers
# File 'lib/octokit/client/issues.rb', line 172
def unlock_issue(repo, number, = {}) boolean_from_response :delete, "#{Repository.path repo}/issues/#{number}/lock", end
    #update_comment(repo, number, comment, options = {})  ⇒ Sawyer::Resource 
  
Update a single comment on an issue
# File 'lib/octokit/client/issues.rb', line 296
def update_comment(repo, number, comment, = {}) patch "#{Repository.path repo}/issues/comments/#{number}", .merge({ body: comment }) end
    
      #update_issue(repo, number, title, body, options)  ⇒ Sawyer::Resource 
      #update_issue(repo, number, options)  ⇒ Sawyer::Resource 
    
  
Sawyer::Resource 
      #update_issue(repo, number, options)  ⇒ Sawyer::Resource 
    Update an issue
# File 'lib/octokit/client/issues.rb', line 209
def update_issue(repo, number, *args) arguments = Arguments.new(args) opts = arguments. unless arguments.empty? opts[:title] = arguments.shift opts[:body] = arguments.shift end patch "#{Repository.path repo}/issues/#{number}", opts end
    #user_issues(options = {})  ⇒ Array<Sawyer::Resource> 
  
List all issues across owned and member repositories for the authenticated user
# File 'lib/octokit/client/issues.rb', line 52
def user_issues( = {}) paginate 'user/issues', end