Skip to main content

milestones

Creates, updates, deletes, gets or lists a milestones resource.

Overview

Namemilestones
TypeResource
Idgithub.issues.milestones

Fields

The following fields are returned by SELECT queries:

Response

NameDatatypeDescription
idinteger
node_idstring (example: MDk6TWlsZXN0b25lMTAwMjYwNA==)
closed_atstring (date-time) (example: 2013-02-12T13:22:01Z)
closed_issuesinteger
created_atstring (date-time) (example: 2011-04-10T20:09:31Z)
creatorobjectA GitHub user. (title: Simple User)
descriptionstring (example: Tracking milestone for version 1.0)
due_onstring (date-time) (example: 2012-10-09T23:39:01Z)
html_urlstring (uri) (example: https://github.com/octocat/Hello-World/milestones/v1.0)
labels_urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/milestones/1/labels)
numberintegerThe number of the milestone.
open_issuesinteger
statestringThe state of the milestone. (open, closed) (example: open, default: open)
titlestringThe title of the milestone. (example: v1.0)
updated_atstring (date-time) (example: 2014-03-03T18:58:10Z)
urlstring (uri) (example: https://api.github.com/repos/octocat/Hello-World/milestones/1)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_milestoneselectowner, repo, milestone_numberGets a milestone using the given milestone number.
list_milestonesselectowner, repostate, sort, direction, per_page, pageLists milestones for a repository.
create_milestoneinsertowner, repo, titleCreates a milestone.
update_milestoneupdateowner, repo, milestone_number
delete_milestonedeleteowner, repo, milestone_numberDeletes a milestone using the given milestone number.

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
milestone_numberintegerThe number that identifies the milestone.
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.
directionstringThe direction of the sort. Either asc or desc.
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."
sortstringWhat to sort results by. Either due_on or completeness.
statestringThe state of the milestone. Either open, closed, or all.

SELECT examples

Gets a milestone using the given milestone number.

SELECT
id,
node_id,
closed_at,
closed_issues,
created_at,
creator,
description,
due_on,
html_url,
labels_url,
number,
open_issues,
state,
title,
updated_at,
url
FROM github.issues.milestones
WHERE owner = '{{ owner }}' -- required
AND repo = '{{ repo }}' -- required
AND milestone_number = '{{ milestone_number }}' -- required
;

INSERT examples

Creates a milestone.

INSERT INTO github.issues.milestones (
title,
state,
description,
due_on,
owner,
repo
)
SELECT
'{{ title }}' /* required */,
'{{ state }}',
'{{ description }}',
'{{ due_on }}',
'{{ owner }}',
'{{ repo }}'
RETURNING
id,
node_id,
closed_at,
closed_issues,
created_at,
creator,
description,
due_on,
html_url,
labels_url,
number,
open_issues,
state,
title,
updated_at,
url
;

UPDATE examples

No description available.

UPDATE github.issues.milestones
SET
title = '{{ title }}',
state = '{{ state }}',
description = '{{ description }}',
due_on = '{{ due_on }}'
WHERE
owner = '{{ owner }}' --required
AND repo = '{{ repo }}' --required
AND milestone_number = '{{ milestone_number }}' --required
RETURNING
id,
node_id,
closed_at,
closed_issues,
created_at,
creator,
description,
due_on,
html_url,
labels_url,
number,
open_issues,
state,
title,
updated_at,
url;

DELETE examples

Deletes a milestone using the given milestone number.

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