Skip to main content

assignees

Creates, updates, deletes, gets or lists an assignees resource.

Overview

Nameassignees
TypeResource
Idgithub.issues.assignees

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
namestring
gravatar_idstring (example: 41d064eb2195891e12d0413f63227ea7)
node_idstring (example: MDQ6VXNlcjE=)
avatar_urlstring (uri) (example: https://github.com/images/error/octocat_happy.gif)
emailstring
events_urlstring (example: https://api.github.com/users/octocat/events{/privacy})
followers_urlstring (uri) (example: https://api.github.com/users/octocat/followers)
following_urlstring (example: https://api.github.com/users/octocat/following{/other_user})
gists_urlstring (example: https://api.github.com/users/octocat/gists{/gist_id})
html_urlstring (uri) (example: https://github.com/octocat)
loginstring (example: octocat)
organizations_urlstring (uri) (example: https://api.github.com/users/octocat/orgs)
received_events_urlstring (uri) (example: https://api.github.com/users/octocat/received_events)
repos_urlstring (uri) (example: https://api.github.com/users/octocat/repos)
site_adminboolean
starred_atstring (example: "2020-07-09T00:17:55Z")
starred_urlstring (example: https://api.github.com/users/octocat/starred{/owner}{/repo})
subscriptions_urlstring (uri) (example: https://api.github.com/users/octocat/subscriptions)
typestring (example: User)
urlstring (uri) (example: https://api.github.com/users/octocat)
user_view_typestring (example: public)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_assigneesselectowner, repoper_page, pageLists the available assignees for issues in a repository.
add_assigneesinsertowner, repo, issue_numberAdds up to 10 assignees to an issue. Users already assigned to an issue are not replaced.
remove_assigneesdeleteowner, repo, issue_numberRemoves one or more assignees from an issue.
check_user_can_be_assignedexecowner, repo, assigneeChecks 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.
check_user_can_be_assigned_to_issueexecowner, repo, issue_number, assigneeChecks 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
assigneestring
issue_numberintegerThe number that identifies the issue.
ownerstringThe account owner of the repository. The name is not case sensitive.
repostringThe name of the repository without the .git extension. The name is not case sensitive.
pageintegerThe page number of the results to fetch. For more information, see "Using pagination in the REST API."
per_pageintegerThe number of results per page (max 100). For more information, see "Using pagination in the REST API."

SELECT examples

Lists the available assignees for issues in a repository.

SELECT
id,
name,
gravatar_id,
node_id,
avatar_url,
email,
events_url,
followers_url,
following_url,
gists_url,
html_url,
login,
organizations_url,
received_events_url,
repos_url,
site_admin,
starred_at,
starred_url,
subscriptions_url,
type,
url,
user_view_type
FROM github.issues.assignees
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

INSERT examples

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

INSERT INTO github.issues.assignees (
assignees,
owner,
repo,
issue_number
)
SELECT
'{{ assignees }}',
'{{ owner }}',
'{{ repo }}',
'{{ issue_number }}'
RETURNING
id,
node_id,
active_lock_reason,
assignee,
assignees,
author_association,
body,
body_html,
body_text,
closed_at,
closed_by,
comments,
comments_url,
created_at,
draft,
events_url,
html_url,
issue_dependencies_summary,
issue_field_values,
labels,
labels_url,
locked,
milestone,
number,
parent_issue_url,
performed_via_github_app,
pinned_comment,
pull_request,
reactions,
repository,
repository_url,
state,
state_reason,
sub_issues_summary,
timeline_url,
title,
type,
updated_at,
url,
user
;

DELETE examples

Removes one or more assignees from an issue.

DELETE FROM github.issues.assignees
WHERE owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND issue_number = '{{ issue_number }}' --required
;

Lifecycle Methods

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.

EXEC github.issues.assignees.check_user_can_be_assigned 
@owner='{{ owner }}' --required,
@repo='{{ repo }}' --required,
@assignee='{{ assignee }}' --required
;