Skip to main content

issue_sub_issues

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

Overview

Nameissue_sub_issues
TypeResource
Idgithub.issues.issue_sub_issues

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger (int64)
node_idstring
active_lock_reasonstring
assigneeobjectA GitHub user. (title: Simple User)
assigneesarray
author_associationstringHow the author is associated with the repository. (COLLABORATOR, CONTRIBUTOR, FIRST_TIMER, FIRST_TIME_CONTRIBUTOR, MANNEQUIN, MEMBER, NONE, OWNER) (title: author_association, example: OWNER)
bodystringContents of the issue (example: It looks like the new widget form is broken on Safari. When I try and create the widget, Safari crashes. This is reproducible on 10.8, but not 10.9. Maybe a browser bug?)
body_htmlstring
body_textstring
closed_atstring (date-time)
closed_byobjectA GitHub user. (title: Simple User)
commentsinteger
comments_urlstring (uri)
created_atstring (date-time)
draftboolean
events_urlstring (uri)
html_urlstring (uri)
issue_dependencies_summaryobject (title: Issue Dependencies Summary)
issue_field_valuesarray
labelsarrayLabels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository
labels_urlstring
lockedboolean
milestoneobjectA collection of related issues and pull requests. (title: Milestone)
numberintegerNumber uniquely identifying the issue within its repository
parent_issue_urlstring (uri)URL to get the parent issue of this issue, if it is a sub-issue
performed_via_github_appobjectGitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. (title: GitHub app)
pinned_commentobjectComments provide a way for people to collaborate on an issue. (title: Issue Comment)
pull_requestobject
reactionsobject (title: Reaction Rollup)
repositoryobjectA repository on GitHub. (title: Repository)
repository_urlstring (uri)
statestringState of the issue; either 'open' or 'closed' (example: open)
state_reasonstringThe reason for the current state (completed, reopened, not_planned, duplicate) (example: not_planned)
sub_issues_summaryobject (title: Sub-issues Summary)
timeline_urlstring (uri)
titlestringTitle of the issue (example: Widget creation fails in Safari on OS X 10.8)
typeobjectThe type of issue. (title: Issue Type)
updated_atstring (date-time)
urlstring (uri)URL for the issue (example: https://api.github.com/repositories/42/issues/1)
userobjectA GitHub user. (title: Simple User)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_sub_issuesselectowner, repo, issue_numberper_page, pageYou can use the REST API to list the sub-issues on an issue.

This endpoint supports the following custom media types. For more information, see Media types.

- application/vnd.github.raw+json: Returns the raw Markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the Markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's Markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
add_sub_issueinsertowner, repo, issue_number, sub_issue_idYou can use the REST API to add sub-issues to issues.

Creating content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "Rate limits for the API"
and "Best practices for using the REST API."

This endpoint supports the following custom media types. For more information, see "Media types."

- application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.
reprioritize_sub_issueupdateowner, repo, issue_number, sub_issue_idYou can use the REST API to reprioritize a sub-issue to a different position in the parent list.
remove_sub_issuedeleteowner, repo, issue_numberYou can use the REST API to remove a sub-issue from an issue.
Removing content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "Rate limits for the API"
and "Best practices for using the REST API."
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass a specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.

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

You can use the REST API to list the sub-issues on an issue.

This endpoint supports the following custom media types. For more information, see Media types.

- application/vnd.github.raw+json: Returns the raw Markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the Markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's Markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.

SELECT
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
FROM github.issues.issue_sub_issues
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND issue_number = '{{ issue_number }}' -- required
AND per_page = '{{ per_page }}'
AND page = '{{ page }}'
;

INSERT examples

You can use the REST API to add sub-issues to issues.

Creating content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "Rate limits for the API"
and "Best practices for using the REST API."

This endpoint supports the following custom media types. For more information, see "Media types."

- application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass any specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.

INSERT INTO github.issues.issue_sub_issues (
sub_issue_id,
replace_parent,
owner,
repo,
issue_number
)
SELECT
{{ sub_issue_id }} /* required */,
{{ replace_parent }},
'{{ 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
;

UPDATE examples

You can use the REST API to reprioritize a sub-issue to a different position in the parent list.

UPDATE github.issues.issue_sub_issues
SET
sub_issue_id = {{ sub_issue_id }},
after_id = {{ after_id }},
before_id = {{ before_id }}
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND issue_number = '{{ issue_number }}' --required
AND sub_issue_id = '{{ sub_issue_id }}' --required
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

You can use the REST API to remove a sub-issue from an issue.
Removing content too quickly using this endpoint may result in secondary rate limiting.
For more information, see "Rate limits for the API"
and "Best practices for using the REST API."
This endpoint supports the following custom media types. For more information, see "Media types."
- application/vnd.github.raw+json: Returns the raw markdown body. Response will include body. This is the default if you do not pass a specific media type.
- application/vnd.github.text+json: Returns a text only representation of the markdown body. Response will include body_text.
- application/vnd.github.html+json: Returns HTML rendered from the body's markdown. Response will include body_html.
- application/vnd.github.full+json: Returns raw, text, and HTML representations. Response will include body, body_text, and body_html.

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