View Source GitHub.Issues (GitHub REST API Client v0.2.2)

Provides API endpoints related to issues

Link to this section Summary

Functions

List issues assigned to the authenticated user

List issue comments for a repository

List issue events for a repository

List user account issues assigned to the authenticated user

List organization issues assigned to the authenticated user

List labels for a repository

Link to this section Functions

Link to this function

add_assignees(owner, repo, issue_number, body, opts \\ [])

View Source
@spec add_assignees(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Issue.t()} | {:error, GitHub.Error.t()}

Add assignees to an issue

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

resources

Resources

Link to this function

add_labels(owner, repo, issue_number, body, opts \\ [])

View Source
@spec add_labels(
  String.t(),
  String.t(),
  integer(),
  map() | String.t() | [map()] | [String.t()],
  keyword()
) :: {:ok, [GitHub.Label.t()]} | {:error, GitHub.Error.t()}

Add labels to an issue

Adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue.

resources

Resources

Link to this function

check_user_can_be_assigned(owner, repo, assignee, opts \\ [])

View Source
@spec check_user_can_be_assigned(String.t(), String.t(), String.t(), keyword()) ::
  :ok | {:error, GitHub.Error.t()}

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.

resources

Resources

Link to this function

check_user_can_be_assigned_to_issue(owner, repo, issue_number, assignee, opts \\ [])

View Source
@spec check_user_can_be_assigned_to_issue(
  String.t(),
  String.t(),
  integer(),
  String.t(),
  keyword()
) ::
  :ok | {:error, GitHub.Error.t()}

Check if a user can be assigned to a issue

Checks if a user has permission to be assigned to a specific issue.

If the assignee can be assigned to this issue, a 204 status code with no content is returned.

Otherwise a 404 status code is returned.

resources

Resources

Link to this function

create(owner, repo, body, opts \\ [])

View Source
@spec create(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Issue.t()} | {:error, GitHub.Error.t()}

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 secondary rate limiting. See "Secondary rate limits" and "Dealing with secondary rate limits" for details.

resources

Resources

Link to this function

create_comment(owner, repo, issue_number, body, opts \\ [])

View Source
@spec create_comment(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Issue.Comment.t()} | {:error, GitHub.Error.t()}

Create an issue comment

You can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

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

resources

Resources

Link to this function

create_label(owner, repo, body, opts \\ [])

View Source
@spec create_label(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Label.t()} | {:error, GitHub.Error.t()}

Create a label

Creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid hexadecimal color code.

resources

Resources

Link to this function

create_milestone(owner, repo, body, opts \\ [])

View Source
@spec create_milestone(String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Milestone.t()} | {:error, GitHub.Error.t()}

Create a milestone

Creates a milestone.

resources

Resources

Link to this function

delete_comment(owner, repo, comment_id, opts \\ [])

View Source
@spec delete_comment(String.t(), String.t(), integer(), keyword()) ::
  :ok | {:error, GitHub.Error.t()}

Delete an issue comment

You can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

resources

Resources

Link to this function

delete_label(owner, repo, name, opts \\ [])

View Source
@spec delete_label(String.t(), String.t(), String.t(), keyword()) ::
  :ok | {:error, GitHub.Error.t()}

Delete a label

Deletes a label using the given label name.

resources

Resources

Link to this function

delete_milestone(owner, repo, milestone_number, opts \\ [])

View Source
@spec delete_milestone(String.t(), String.t(), integer(), keyword()) ::
  :ok | {:error, GitHub.Error.t()}

Delete a milestone

Deletes a milestone using the given milestone number.

resources

Resources

Link to this function

get(owner, repo, issue_number, opts \\ [])

View Source
@spec get(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.Issue.t()} | {:error, GitHub.Error.t()}

Get an issue

The API returns a 301 Moved Permanently status if the issue was transferred 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 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.

resources

Resources

Link to this function

get_comment(owner, repo, comment_id, opts \\ [])

View Source
@spec get_comment(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.Issue.Comment.t()} | {:error, GitHub.Error.t()}

Get an issue comment

You can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

resources

Resources

Link to this function

get_event(owner, repo, event_id, opts \\ [])

View Source
@spec get_event(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.Issue.Event.t()} | {:error, GitHub.Error.t()}

Get an issue event

Gets a single event by the event id.

resources

Resources

Link to this function

get_label(owner, repo, name, opts \\ [])

View Source
@spec get_label(String.t(), String.t(), String.t(), keyword()) ::
  {:ok, GitHub.Label.t()} | {:error, GitHub.Error.t()}

Get a label

Gets a label using the given name.

resources

Resources

Link to this function

get_milestone(owner, repo, milestone_number, opts \\ [])

View Source
@spec get_milestone(String.t(), String.t(), integer(), keyword()) ::
  {:ok, GitHub.Milestone.t()} | {:error, GitHub.Error.t()}

Get a milestone

Gets a milestone using the given milestone number.

resources

Resources

@spec list(keyword()) :: {:ok, [GitHub.Issue.t()]} | {:error, GitHub.Error.t()}

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 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.

options

Options

  • filter: Indicates which sorts of issues to return. assigned means issues assigned to you. created means issues created by you. mentioned means issues mentioning you. subscribed means issues you're subscribed to updates for. all or repos means all issues you can see, regardless of participation or creation.
  • state: Indicates the state of the issues to return.
  • labels: A list of comma separated label names. Example: bug,ui,@high
  • sort: What to sort results by.
  • direction: The direction to sort the results by.
  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • collab
  • orgs
  • owned
  • pulls
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_assignees(owner, repo, opts \\ [])

View Source
@spec list_assignees(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.User.simple()]} | {:error, GitHub.Error.t()}

List assignees

Lists the available assignees for issues in a repository.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_comments(owner, repo, issue_number, opts \\ [])

View Source
@spec list_comments(String.t(), String.t(), integer(), keyword()) ::
  {:ok, [GitHub.Issue.Comment.t()]} | {:error, GitHub.Error.t()}

List issue comments

You can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

Issue comments are ordered by ascending ID.

options

Options

  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_comments_for_repo(owner, repo, opts \\ [])

View Source
@spec list_comments_for_repo(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Issue.Comment.t()]} | {:error, GitHub.Error.t()}

List issue comments for a repository

You can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.

By default, issue comments are ordered by ascending ID.

options

Options

  • sort: The property to sort the results by.
  • direction: Either asc or desc. Ignored without the sort parameter.
  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_events(owner, repo, issue_number, opts \\ [])

View Source

List issue events

Lists all events for an issue.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_events_for_repo(owner, repo, opts \\ [])

View Source
@spec list_events_for_repo(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Issue.Event.t()]} | {:error, GitHub.Error.t()}

List issue events for a repository

Lists events for a repository.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_events_for_timeline(owner, repo, issue_number, opts \\ [])

View Source

List timeline events for an issue

List all timeline events for an issue.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_for_authenticated_user(opts \\ [])

View Source
@spec list_for_authenticated_user(keyword()) ::
  {:ok, [GitHub.Issue.t()]} | {:error, GitHub.Error.t()}

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 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.

options

Options

  • filter: Indicates which sorts of issues to return. assigned means issues assigned to you. created means issues created by you. mentioned means issues mentioning you. subscribed means issues you're subscribed to updates for. all or repos means all issues you can see, regardless of participation or creation.
  • state: Indicates the state of the issues to return.
  • labels: A list of comma separated label names. Example: bug,ui,@high
  • sort: What to sort results by.
  • direction: The direction to sort the results by.
  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_for_org(org, opts \\ [])

View Source
@spec list_for_org(
  String.t(),
  keyword()
) :: {:ok, [GitHub.Issue.t()]} | {:error, GitHub.Error.t()}

List organization issues assigned to the authenticated user

List issues in an organization assigned to the authenticated user.

Note: GitHub's REST API 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.

options

Options

  • filter: Indicates which sorts of issues to return. assigned means issues assigned to you. created means issues created by you. mentioned means issues mentioning you. subscribed means issues you're subscribed to updates for. all or repos means all issues you can see, regardless of participation or creation.
  • state: Indicates the state of the issues to return.
  • labels: A list of comma separated label names. Example: bug,ui,@high
  • sort: What to sort results by.
  • direction: The direction to sort the results by.
  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_for_repo(owner, repo, opts \\ [])

View Source
@spec list_for_repo(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Issue.t()]} | {:error, GitHub.Error.t()}

List repository issues

List issues in a repository. Only open issues will be listed.

Note: GitHub's REST API 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.

options

Options

  • milestone: 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.
  • state: Indicates the state of the issues to return.
  • assignee: Can be the name of a user. Pass in none for issues with no assigned user, and * for issues assigned to any user.
  • creator: The user that created the issue.
  • mentioned: A user that's mentioned in the issue.
  • labels: A list of comma separated label names. Example: bug,ui,@high
  • sort: What to sort results by.
  • direction: The direction to sort the results by.
  • since: Only show results that were last updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_labels_for_milestone(owner, repo, milestone_number, opts \\ [])

View Source
@spec list_labels_for_milestone(String.t(), String.t(), integer(), keyword()) ::
  {:ok, [GitHub.Label.t()]} | {:error, GitHub.Error.t()}

List labels for issues in a milestone

Lists labels for issues in a milestone.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_labels_for_repo(owner, repo, opts \\ [])

View Source
@spec list_labels_for_repo(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Label.t()]} | {:error, GitHub.Error.t()}

List labels for a repository

Lists all labels for a repository.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_labels_on_issue(owner, repo, issue_number, opts \\ [])

View Source
@spec list_labels_on_issue(String.t(), String.t(), integer(), keyword()) ::
  {:ok, [GitHub.Label.t()]} | {:error, GitHub.Error.t()}

List labels for an issue

Lists all labels for an issue.

options

Options

  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

list_milestones(owner, repo, opts \\ [])

View Source
@spec list_milestones(String.t(), String.t(), keyword()) ::
  {:ok, [GitHub.Milestone.t()]} | {:error, GitHub.Error.t()}

List milestones

Lists milestones for a repository.

options

Options

  • state: The state of the milestone. Either open, closed, or all.
  • sort: What to sort results by. Either due_on or completeness.
  • direction: The direction of the sort. Either asc or desc.
  • per_page: The number of results per page (max 100).
  • page: Page number of the results to fetch.

resources

Resources

Link to this function

lock(owner, repo, issue_number, body, opts \\ [])

View Source
@spec lock(String.t(), String.t(), integer(), map() | nil, keyword()) ::
  :ok | {:error, GitHub.Error.t()}

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."

resources

Resources

Link to this function

remove_all_labels(owner, repo, issue_number, opts \\ [])

View Source
@spec remove_all_labels(String.t(), String.t(), integer(), keyword()) ::
  :ok | {:error, GitHub.Error.t()}

Remove all labels from an issue

Removes all labels from an issue.

resources

Resources

Link to this function

remove_assignees(owner, repo, issue_number, body, opts \\ [])

View Source
@spec remove_assignees(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Issue.t()} | {:error, GitHub.Error.t()}

Remove assignees from an issue

Removes one or more assignees from an issue.

resources

Resources

Link to this function

remove_label(owner, repo, issue_number, name, opts \\ [])

View Source
@spec remove_label(String.t(), String.t(), integer(), String.t(), keyword()) ::
  {:ok, [GitHub.Label.t()]} | {:error, GitHub.Error.t()}

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.

resources

Resources

Link to this function

set_labels(owner, repo, issue_number, body, opts \\ [])

View Source
@spec set_labels(
  String.t(),
  String.t(),
  integer(),
  map() | String.t() | [map()] | [String.t()],
  keyword()
) :: {:ok, [GitHub.Label.t()]} | {:error, GitHub.Error.t()}

Set labels for an issue

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

resources

Resources

Link to this function

unlock(owner, repo, issue_number, opts \\ [])

View Source
@spec unlock(String.t(), String.t(), integer(), keyword()) ::
  :ok | {:error, GitHub.Error.t()}

Unlock an issue

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

resources

Resources

Link to this function

update(owner, repo, issue_number, body, opts \\ [])

View Source
@spec update(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Issue.t()} | {:error, GitHub.Error.t()}

Update an issue

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

resources

Resources

Link to this function

update_comment(owner, repo, comment_id, body, opts \\ [])

View Source
@spec update_comment(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Issue.Comment.t()} | {:error, GitHub.Error.t()}

Update an issue comment

You can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.

resources

Resources

Link to this function

update_label(owner, repo, name, body, opts \\ [])

View Source
@spec update_label(String.t(), String.t(), String.t(), map(), keyword()) ::
  {:ok, GitHub.Label.t()} | {:error, GitHub.Error.t()}

Update a label

Updates a label using the given label name.

resources

Resources

Link to this function

update_milestone(owner, repo, milestone_number, body, opts \\ [])

View Source
@spec update_milestone(String.t(), String.t(), integer(), map(), keyword()) ::
  {:ok, GitHub.Milestone.t()} | {:error, GitHub.Error.t()}

Update a milestone

resources

Resources