View Source GitHub.Issues (GitHub REST API Client v0.2.2)
Provides API endpoints related to issues
Link to this section Summary
Functions
Add assignees to an issue
Add labels to an issue
Check if a user can be assigned
Check if a user can be assigned to a issue
Create an issue
Create an issue comment
Create a label
Create a milestone
Delete an issue comment
Delete a label
Delete a milestone
Get an issue
Get an issue comment
Get an issue event
Get a label
Get a milestone
List issues assigned to the authenticated user
List assignees
List issue comments
List issue comments for a repository
List issue events
List issue events for a repository
List timeline events for an issue
List user account issues assigned to the authenticated user
List organization issues assigned to the authenticated user
List repository issues
List labels for issues in a milestone
List labels for a repository
List labels for an issue
List milestones
Lock an issue
Remove all labels from an issue
Remove assignees from an issue
Remove a label from an issue
Set labels for an issue
Unlock an issue
Update an issue
Update an issue comment
Update a label
Update a milestone
Link to this section Functions
@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
@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
@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
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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
@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
orrepos
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
@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
@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
@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
: Eitherasc
ordesc
. Ignored without thesort
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
@spec list_events(String.t(), String.t(), integer(), keyword()) :: {:ok, [ GitHub.Issue.Event.AddedToProject.t() | GitHub.Issue.Event.Assigned.t() | GitHub.Issue.Event.ConvertedNoteToIssue.t() | GitHub.Issue.Event.Demilestoned.t() | GitHub.Issue.Event.Labeled.t() | GitHub.Issue.Event.Locked.t() | GitHub.Issue.Event.Milestoned.t() | GitHub.Issue.Event.MovedColumnInProject.t() | GitHub.Issue.Event.RemovedFromProject.t() | GitHub.Issue.Event.Renamed.t() | GitHub.Issue.Event.ReviewDismissed.t() | GitHub.Issue.Event.ReviewRequestRemoved.t() | GitHub.Issue.Event.ReviewRequested.t() | GitHub.Issue.Event.Unassigned.t() | GitHub.Issue.Event.Unlabeled.t() ]} | {:error, GitHub.Error.t()}
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
@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
@spec list_events_for_timeline(String.t(), String.t(), integer(), keyword()) :: {:ok, [ GitHub.Issue.Event.AddedToProject.t() | GitHub.Issue.Event.ConvertedNoteToIssue.t() | GitHub.Issue.Event.Demilestoned.t() | GitHub.Issue.Event.Labeled.t() | GitHub.Issue.Event.Locked.t() | GitHub.Issue.Event.Milestoned.t() | GitHub.Issue.Event.MovedColumnInProject.t() | GitHub.Issue.Event.RemovedFromProject.t() | GitHub.Issue.Event.Renamed.t() | GitHub.Issue.Event.ReviewDismissed.t() | GitHub.Issue.Event.ReviewRequestRemoved.t() | GitHub.Issue.Event.ReviewRequested.t() | GitHub.Issue.Event.StateChange.t() | GitHub.Issue.Event.Unlabeled.t() | GitHub.Timeline.AssignedIssueEvent.t() | GitHub.Timeline.CommentEvent.t() | GitHub.Timeline.CommitCommentedEvent.t() | GitHub.Timeline.CommittedEvent.t() | GitHub.Timeline.CrossReferencedEvent.t() | GitHub.Timeline.LineCommentedEvent.t() | GitHub.Timeline.ReviewedEvent.t() | GitHub.Timeline.UnassignedIssueEvent.t() ]} | {:error, GitHub.Error.t()}
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
@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
orrepos
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
@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
orrepos
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
@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 aninteger
is passed, it should refer to a milestone by itsnumber
field. If the string*
is passed, issues with any milestone are accepted. If the stringnone
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 innone
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
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
@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
@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
@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. Eitheropen
,closed
, orall
.sort
: What to sort results by. Eitherdue_on
orcompleteness
.direction
: The direction of the sort. Eitherasc
ordesc
.per_page
: The number of results per page (max 100).page
: Page number of the results to fetch.
resources
Resources
@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
@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
@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
@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
@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
@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
@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
@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
@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
@spec update_milestone(String.t(), String.t(), integer(), map(), keyword()) :: {:ok, GitHub.Milestone.t()} | {:error, GitHub.Error.t()}
Update a milestone