Skip to content

Latest commit

 

History

History
198 lines (135 loc) · 3.99 KB

File metadata and controls

198 lines (135 loc) · 3.99 KB
title Issues | GitHub API

Issues API

  • TOC {:toc}

Issues leverage these custom mime types. You can read more about the use of mime types in the API here.

List issues

List all issues across all the authenticated user's visible repositories including owned repositories, member repositories, and organization repositories:

GET /issues

List all issues across owned and member repositories for the authenticated user:

GET /user/issues

List all issues for a given organization for the authenticated user:

GET /orgs/:org/issues

Parameters

filter : * assigned: Issues assigned to you (default)

  • created: Issues created by you
  • mentioned: Issues mentioning you
  • subscribed: Issues you're subscribed to updates for
  • all: All issues the authenticated user can see, regardless of particpation or creation

state : open, closed, default: open

labels : String list of comma separated Label names. Example: bug,ui,@high

sort : created, updated, comments, default: created.

direction : asc or desc, default: desc.

since : Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

Response

<%= headers 200, :pagination => true %> <%= json(:issue) { |h| [h] } %>

List issues for a repository

GET /repos/:owner/:repo/issues

Parameters

milestone : * Integer Milestone number

  • none for Issues with no Milestone.
  • * for Issues with any Milestone.

state : open, closed, default: open

assignee : * String User login

  • none for Issues with no assigned User.
  • * for Issues with any assigned User.

creator : String User login.

mentioned : String User login.

labels : String list of comma separated Label names. Example: bug,ui,@high

sort : created, updated, comments, default: created

direction : asc or desc, default: desc.

since : Optional string of a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ

Response

<%= headers 200, :pagination => true %> <%= json(:issue) { |h| [h] } %>

Get a single issue

GET /repos/:owner/:repo/issues/:number

Response

<%= headers 200 %> <%= json :issue %>

Create an issue

POST /repos/:owner/:repo/issues

Input

title : Required string

body : Optional string

assignee : Optional string - Login for the user that this issue should be assigned to.

milestone : Optional number - Milestone to associate this issue with.

labels : Optional array of strings - Labels to associate with this issue.

<%= json
:title => "Found a bug", :body => "I'm having a problem with this.", :assignee => "octocat", :milestone => 1, :labels => %w(Label1 Label2) %>

Response

<%= headers 201, :Location => 'https://api.github.com/repos/user/repo/issues/1' %> <%= json :issue %>

Edit an issue

PATCH /repos/:owner/:repo/issues/:number

Input

title : Optional string

body : Optional string

assignee : Optional string - Login for the user that this issue should be assigned to.

state : Optional string - State of the issue: open or closed.

milestone : Optional number - Milestone to associate this issue with.

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.

<%= json
:title => "Found a bug", :body => "I'm having a problem with this.", :assignee => "octocat", :milestone => 1, :state => "open", :labels => %w(Label1 Label2) %>

Response

<%= headers 200 %> <%= json :issue %>

Custom Mime Types

These are the supported mime types for issues. You can read more about the use of mime types in the API here.

application/vnd.github.VERSION.raw+json
application/vnd.github.VERSION.text+json
application/vnd.github.VERSION.html+json
application/vnd.github.VERSION.full+json