Add assignees to an issue

Adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.

octokit.issues.addAssignees({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

assigneesno

Usernames of people to assign this issue to. NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise.

See also: GitHub Developer Guide documentation.

Add labels to an issue

octokit.issues.addLabels({
owner,
repo,
issue_number,
labels,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

labelsyes

The name of the label to add to the issue. Must contain at least one label. Note: Alternatively, you can pass a single label as a string or an array of labels directly, but GitHub recommends passing an object with the labels key.

See also: GitHub Developer Guide documentation.

Check if a user can be assigned

Checks if a user has permission to be assigned to an issue in this repository.

If the assignee can be assigned to issues in the repository, a 204 header with no content is returned.

Otherwise a 404 status code is returned.

octokit.issues.checkUserCanBeAssigned({
owner,
repo,
assignee,
});

Parameters

namerequireddescription
owneryes
repoyes
assigneeyes

See also: GitHub Developer Guide documentation.

Create an issue

Any user with pull access to a repository can create an issue. If issues are disabled in the repository, the API returns a 410 Gone status.

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.

octokit.issues.create({
owner,
repo,
title,
});

Parameters

namerequireddescription
owneryes
repoyes
titleyes

The title of the issue.

bodyno

The contents of the issue.

assigneeno

Login for the user that this issue should be assigned to. NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. This field is deprecated.

milestoneno
labelsno

Labels to associate with this issue. NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise.

assigneesno

Logins for Users to assign to this issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise.

See also: GitHub Developer Guide documentation.

Create an issue comment

This endpoint triggers notifications. Creating content too quickly using this endpoint may result in abuse rate limiting. See "Abuse rate limits" and "Dealing with abuse rate limits" for details.

octokit.issues.createComment({
owner,
repo,
issue_number,
body,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

bodyyes

The contents of the comment.

See also: GitHub Developer Guide documentation.

Create a label

octokit.issues.createLabel({
owner,
repo,
name,
});

Parameters

namerequireddescription
owneryes
repoyes
nameyes

The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing :strawberry: will render the emoji :strawberry:. For a full list of available emoji and codes, see emoji-cheat-sheet.com.

colorno

The hexadecimal color code for the label, without the leading #.

descriptionno

A short description of the label.

See also: GitHub Developer Guide documentation.

Create a milestone

octokit.issues.createMilestone({
owner,
repo,
title,
});

Parameters

namerequireddescription
owneryes
repoyes
titleyes

The title of the milestone.

stateno

The state of the milestone. Either open or closed.

descriptionno

A description of the milestone.

due_onno

The milestone due date. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

See also: GitHub Developer Guide documentation.

Delete an issue comment

octokit.issues.deleteComment({
owner,
repo,
comment_id,
});

Parameters

namerequireddescription
owneryes
repoyes
comment_idyes

comment_id parameter

See also: GitHub Developer Guide documentation.

Delete a label

octokit.issues.deleteLabel({
owner,
repo,
name,
});

Parameters

namerequireddescription
owneryes
repoyes
nameyes

See also: GitHub Developer Guide documentation.

Delete a milestone

octokit.issues.deleteMilestone({
owner,
repo,
milestone_number,
});

Parameters

namerequireddescription
owneryes
repoyes
milestone_numberyes

milestone_number parameter

See also: GitHub Developer Guide documentation.

Get an issue

The API returns a 301 Moved Permanently status if the issue wastransferred to another repository. If the issue was transferred to or deleted from a repository where the authenticated user lacks read access, the API returns a 404 Not Found status. If the issue was deleted from a repository where the authenticated user has read access, the API returns a 410 Gone status. To receive webhook events for transferred and deleted issues, subscribe to the issues webhook.

Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.

octokit.issues.get({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

See also: GitHub Developer Guide documentation.

Get an issue comment

octokit.issues.getComment({
owner,
repo,
comment_id,
});

Parameters

namerequireddescription
owneryes
repoyes
comment_idyes

comment_id parameter

See also: GitHub Developer Guide documentation.

Get an issue event

octokit.issues.getEvent({
owner,
repo,
event_id,
});

Parameters

namerequireddescription
owneryes
repoyes
event_idyes

See also: GitHub Developer Guide documentation.

Get a label

octokit.issues.getLabel({
owner,
repo,
name,
});

Parameters

namerequireddescription
owneryes
repoyes
nameyes

See also: GitHub Developer Guide documentation.

Get a milestone

octokit.issues.getMilestone({
owner,
repo,
milestone_number,
});

Parameters

namerequireddescription
owneryes
repoyes
milestone_numberyes

milestone_number parameter

See also: GitHub Developer Guide documentation.

List issues assigned to the authenticated user

List issues assigned to the authenticated user across all visible repositories including owned repositories, member repositories, and organization repositories. You can use the filter query parameter to fetch issues that are not necessarily assigned to you.

Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.

octokit.issues.list();

Parameters

namerequireddescription
filterno

Indicates which sorts of issues to return. Can be one of:
* assigned: Issues assigned to you
* 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 participation or creation

stateno

Indicates the state of the issues to return. Can be either open, closed, or all.

labelsno

A list of comma separated label names. Example: bug,ui,@high

sortno

What to sort results by. Can be either created, updated, comments.

directionno

One of asc (ascending) or desc (descending).

sinceno

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

collabno
orgsno
ownedno
pullsno
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List assignees

Lists the available assignees for issues in a repository.

octokit.issues.listAssignees({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List issue comments

Issue Comments are ordered by ascending ID.

octokit.issues.listComments({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

sinceno

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List issue comments for a repository

By default, Issue Comments are ordered by ascending ID.

octokit.issues.listCommentsForRepo({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes
sortno

One of created (when the repository was starred) or updated (when it was last pushed to).

directionno

Either asc or desc. Ignored without the sort parameter.

sinceno

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List issue events

octokit.issues.listEvents({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List issue events for a repository

octokit.issues.listEventsForRepo({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List timeline events for an issue

octokit.issues.listEventsForTimeline({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List user account issues assigned to the authenticated user

List issues across owned and member repositories assigned to the authenticated user.

Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.

octokit.issues.listForAuthenticatedUser();

Parameters

namerequireddescription
filterno

Indicates which sorts of issues to return. Can be one of:
* assigned: Issues assigned to you
* 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 participation or creation

stateno

Indicates the state of the issues to return. Can be either open, closed, or all.

labelsno

A list of comma separated label names. Example: bug,ui,@high

sortno

What to sort results by. Can be either created, updated, comments.

directionno

One of asc (ascending) or desc (descending).

sinceno

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List organization issues assigned to the authenticated user

List issues in an organization assigned to the authenticated user.

Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.

octokit.issues.listForOrg({
org,
});

Parameters

namerequireddescription
orgyes
filterno

Indicates which sorts of issues to return. Can be one of:
* assigned: Issues assigned to you
* 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 participation or creation

stateno

Indicates the state of the issues to return. Can be either open, closed, or all.

labelsno

A list of comma separated label names. Example: bug,ui,@high

sortno

What to sort results by. Can be either created, updated, comments.

directionno

One of asc (ascending) or desc (descending).

sinceno

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List repository issues

List issues in a repository.

Note: GitHub's REST API v3 considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the pull_request key. Be aware that the id of a pull request returned from "Issues" endpoints will be an issue id. To find out the pull request id, use the "List pull requests" endpoint.

octokit.issues.listForRepo({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes
milestoneno

If an integer is passed, it should refer to a milestone by its number field. If the string * is passed, issues with any milestone are accepted. If the string none is passed, issues without milestones are returned.

stateno

Indicates the state of the issues to return. Can be either open, closed, or all.

assigneeno

Can be the name of a user. Pass in none for issues with no assigned user, and * for issues assigned to any user.

creatorno

The user that created the issue.

mentionedno

A user that's mentioned in the issue.

labelsno

A list of comma separated label names. Example: bug,ui,@high

sortno

What to sort results by. Can be either created, updated, comments.

directionno

One of asc (ascending) or desc (descending).

sinceno

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List labels for issues in a milestone

octokit.issues.listLabelsForMilestone({
owner,
repo,
milestone_number,
});

Parameters

namerequireddescription
owneryes
repoyes
milestone_numberyes

milestone_number parameter

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List labels for a repository

octokit.issues.listLabelsForRepo({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes
per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List labels for an issue

octokit.issues.listLabelsOnIssue({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

List milestones

octokit.issues.listMilestones({
owner,
repo,
});

Parameters

namerequireddescription
owneryes
repoyes
stateno

The state of the milestone. Either open, closed, or all.

sortno

What to sort results by. Either due_on or completeness.

directionno

The direction of the sort. Either asc or desc.

per_pageno

Results per page (max 100)

pageno

Page number of the results to fetch.

See also: GitHub Developer Guide documentation.

Lock an issue

Users with push access can lock an issue or pull request's conversation.

Note that, if you choose not to pass any parameters, you'll need to set Content-Length to zero when calling out to this endpoint. For more information, see "HTTP verbs."

octokit.issues.lock({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

lock_reasonno

The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons:
* off-topic
* too heated
* resolved
* spam

See also: GitHub Developer Guide documentation.

Remove all labels from an issue

octokit.issues.removeAllLabels({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

See also: GitHub Developer Guide documentation.

Remove assignees from an issue

Removes one or more assignees from an issue.

octokit.issues.removeAssignees({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

assigneesno

Usernames of assignees to remove from an issue. NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise.

See also: GitHub Developer Guide documentation.

Remove a label from an issue

Removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a 404 Not Found status if the label does not exist.

octokit.issues.removeLabel({
owner,
repo,
issue_number,
name,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

nameyes

See also: GitHub Developer Guide documentation.

Set labels for an issue

Removes any previous labels and sets the new labels for an issue.

octokit.issues.setLabels({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

labelsno

The names of the labels to add to the issue. You can pass an empty array to remove all labels. Note: Alternatively, you can pass a single label as a string or an array of labels directly, but GitHub recommends passing an object with the labels key.

See also: GitHub Developer Guide documentation.

Unlock an issue

Users with push access can unlock an issue's conversation.

octokit.issues.unlock({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

See also: GitHub Developer Guide documentation.

Update an issue

Issue owners and users with push access can edit an issue.

octokit.issues.update({
owner,
repo,
issue_number,
});

Parameters

namerequireddescription
owneryes
repoyes
issue_numberyes

issue_number parameter

titleno

The title of the issue.

bodyno

The contents of the issue.

assigneeno

Login for the user that this issue should be assigned to. This field is deprecated.

stateno

State of the issue. Either open or closed.

milestoneno
labelsno

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. NOTE: Only users with push access can set labels for issues. Labels are silently dropped otherwise.

assigneesno

Logins for Users to assign to this issue. Pass one or more user logins to replace the set of assignees on this Issue. Send an empty array ([]) to clear all assignees from the Issue. NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise.

See also: GitHub Developer Guide documentation.

Update an issue comment

octokit.issues.updateComment({
owner,
repo,
comment_id,
body,
});

Parameters

namerequireddescription
owneryes
repoyes
comment_idyes

comment_id parameter

bodyyes

The contents of the comment.

See also: GitHub Developer Guide documentation.

Update a label

octokit.issues.updateLabel({
owner,
repo,
name,
});

Parameters

namerequireddescription
owneryes
repoyes
nameyes
new_nameno

The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing :strawberry: will render the emoji :strawberry:. For a full list of available emoji and codes, see emoji-cheat-sheet.com.

colorno

The hexadecimal color code for the label, without the leading #.

descriptionno

A short description of the label.

See also: GitHub Developer Guide documentation.

Update a milestone

octokit.issues.updateMilestone({
owner,
repo,
milestone_number,
});

Parameters

namerequireddescription
owneryes
repoyes
milestone_numberyes

milestone_number parameter

titleno

The title of the milestone.

stateno

The state of the milestone. Either open or closed.

descriptionno

A description of the milestone.

due_onno

The milestone due date. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

See also: GitHub Developer Guide documentation.