Milestone¶
A milestone (Milestone) groups issues and pull requests under a single delivery goal. With the API, you can create, query, update, and delete repository milestones.
Enterprise milestones have their own group (Enterprise); this group covers only repository milestones.
Objects¶
| Object | Description | Related endpoint |
|---|---|---|
| Milestone | Title, description, due date, open/closed state, completion progress | Get all repository milestones |
Identification¶
- A repository is identified by
owner+repo, and a milestone bynumber. - Milestone numbers are unique within a repository and use a separate sequence from issue numbers.
Common tasks¶
| Task | Endpoint |
|---|---|
| List milestones | GET /api/v5/repos/{owner}/{repo}/milestones |
| Create a milestone | POST /api/v5/repos/{owner}/{repo}/milestones |
| Get a single milestone | GET /api/v5/repos/{owner}/{repo}/milestones/{number} |
| Update a milestone | PATCH /api/v5/repos/{owner}/{repo}/milestones/{number} |
| Delete a milestone | DELETE /api/v5/repos/{owner}/{repo}/milestones/{number} |
Notes¶
- The update method is
PATCH(notPUT); submit only the fields you want to change. - Milestones are defined only at the repository level; enterprise milestones and enterprise issue custom fields are in the Enterprise group.
- To attach an issue to a milestone, pass the milestone field in the issue update endpoint; this group does not provide a linking endpoint.
Endpoint list¶
This module contains 5 endpoints.
| # | Endpoint | Method and path | Description |
|---|---|---|---|
| 1 | Get all repository milestones | GET /api/v5/repos/{owner}/{repo}/milestones |
This endpoint retrieves all milestones in the specified repository. It supports filtering by state (open, closed, or all), sorting by due date, and paginated viewing, returning the… |
| 2 | Create a repository milestone | POST /api/v5/repos/{owner}/{repo}/milestones |
This endpoint creates a milestone in the specified repository. It supports setting the milestone title, description, due date, and state, and returns the complete information of the created milestone. |
| 3 | Get a single repository milestone | GET /api/v5/repos/{owner}/{repo}/milestones/{number} |
This endpoint retrieves detailed information about a single milestone in the specified repository, including the milestone title, description, state, due date, creation and update times, and the associated closed… |
| 4 | Delete a single repository milestone | DELETE /api/v5/repos/{owner}/{repo}/milestones/{number} |
This endpoint deletes a single milestone in the specified repository. On success it returns an empty response body; if the target milestone does not exist, it returns a 404 error. |
| 5 | Update a repository milestone | PATCH /api/v5/repos/{owner}/{repo}/milestones/{number} |
This endpoint updates milestone information in the specified repository. You can change the milestone title, state, description, and due date, and it returns the updated milestone details. |
Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc