Skip to content

Get a specific issue of a repository

GET /api/v5/repos/{owner}/{repo}/issues/{number}

Retrieves detailed information about an issue in the specified repository, including title, content, state, creator, comment count, labels, milestone, and custom fields.

Access token support

  • AtomGit user access token (AtomGit user access tokens)

Anonymous access

This endpoint allows anonymous access.

Request parameters

Parameter Location Type Required Description
owner path string Yes Address path of the namespace that owns the repository (the address path of an enterprise, organization, or individual)
repo path string Yes Repository path (path)
number path string Yes Issue number (case-sensitive; do not add the # sign)
access_token query string No User authorization code

Response parameters

Field Type Always returned Nullable Description
id integer Yes No Issue ID
html_url string Yes No Web address of the issue
number integer Yes No Issue number
state string Yes No Issue state (such as opened / closed)
title string Yes No Issue title
body string Yes No Issue content
user object Yes No Information about the user who created the issue
assignee object No Yes Information about the assignee; null when unassigned
repository object Yes No Information about the repository the issue belongs to
created_at string Yes No Creation time
updated_at string Yes No Update time
finished_at string No Yes Completion time
labels object[] Yes No List of labels
issue_state string Yes No Issue state identifier
comments integer Yes No Comment count
priority integer No Yes Priority
issue_type string No Yes Issue type
issue_state_detail object No Yes State details
issue_type_detail object No Yes Type details
issue_priority_detail object No Yes Priority details
milestone object No Yes Information about the linked milestone
custom_fields object[] No Yes Custom field information
visibility_reason string No Yes Visibility explanation
stage string No Yes Issue stage (such as New)
severity string No Yes Severity (such as Major)

user object

Field Type Always returned Nullable Description
user.avatar_url string Yes No User avatar address
user.html_url string Yes No User homepage address
user.id string Yes No User ID
user.login string Yes No User login name
user.name string Yes No User name

repository object

Field Type Always returned Nullable Description
repository.id integer Yes No Repository ID
repository.full_name string Yes No Full repository name
repository.path string Yes No Repository path (path)
repository.name string Yes No Repository name
repository.description string Yes No Repository description
repository.created_at string Yes No Creation time
repository.updated_at string Yes No Update time
repository.assigner object Yes Yes Information about the assigner
repository.paas string No Yes Platform identifier the repository belongs to

labels object

Field Type Always returned Nullable Description
labels[].id integer Yes No Label ID
labels[].name string Yes No Label name
labels[].color string Yes No Label color
labels[].created_at string Yes No Label creation time
labels[].updated_at string Yes No Label time added

issue_state_detail object

Field Type Always returned Nullable Description
issue_state_detail.title string Yes No State name
issue_state_detail.serial integer Yes No State ordinal
issue_state_detail.id integer Yes No State ID

issue_type_detail object

Field Type Always returned Nullable Description
issue_type_detail.title string Yes No Type name
issue_type_detail.id integer Yes No Type ID
issue_type_detail.is_system boolean Yes No Whether this is a system type

issue_priority_detail object

Field Type Always returned Nullable Description
issue_priority_detail.id string Yes No Priority ID
issue_priority_detail.title string Yes No Priority name

milestone object

Field Type Always returned Nullable Description
milestone.created_at string Yes No Creation time
milestone.description string Yes No Milestone description
milestone.due_on string Yes No Due date
milestone.number integer Yes No Milestone number
milestone.repository_id integer Yes No ID of the repository the milestone belongs to
milestone.state string Yes No Milestone state
milestone.title string Yes No Milestone title
milestone.updated_at string Yes No Update time
milestone.url string Yes No Milestone address

custom_fields object

Field Type Always returned Nullable Description
custom_fields[].field_name string Yes No Custom field name
custom_fields[].field_type string Yes No Type of the custom field. Enum: text_single (single-line text), text_multi (multi-line text), integer (integer), decimal (decimal), date (date), select_single (single-select dropdown), select_multi (multi-select dropdown), member_single (single member), member_multi (multiple members)
custom_fields[].field_visibility string Yes No Visibility: 0 visible to administrators only, 1 visible to everyone
custom_fields[].field_values string[] Yes No Values of the custom field

Error responses

A 200 success response is not enough: callers need to know what a failure looks like to write error handling.

401 Unauthenticated

{
  "error": "unauthorized",
  "message": "Missing or invalid access token"
}

404 Resource not found

{
  "error": "not_found",
  "message": "Issue not found"
}

Note: The field names in the error response examples above are illustrative; the actual fields returned by the backend take precedence.

HTTP status codes

Status code Description
200 Success (OK)
304 Not modified (Not modified)
401 Requires authentication (Requires authentication)
403 Forbidden (Forbidden)
404 Resource not found (Not found)

Request example

Parameter notes

Replace <owner> with the address path of the namespace that owns the repository (the address path of an enterprise, organization, or individual); replace <repo> with the repository path (path); replace <number> with the issue number; this endpoint allows anonymous access. To pass a token, append ?access_token=<token> (replace <token> with your AtomGit user access token).

cURL

curl -X GET 'https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/<number>' \
  -H 'Accept: application/json'

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/<number>",
  { headers: { "Accept": "application/json" } }
);

if (!response.ok) {
  throw new Error(`Request failed: ${response.status}`);
}

const data = await response.json();
console.log(data);

Python

import requests

resp = requests.get(
    "https://api.atomgit.com/api/v5/repos/<owner>/<repo>/issues/<number>",
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "id": 152212,
  "html_url": "https://api.atomgit.com/dengmengmian/test01/issues/3",
  "number": 3,
  "state": "opened",
  "title": "Test issue",
  "body": "This is sample issue content for demonstration.",
  "user": {
    "avatar_url": "https://api.atomgit.com/avatar/example.png",
    "html_url": "https://api.atomgit.com/dengmengmian",
    "id": "661ce4eab470b1430d456154",
    "login": "dengmengmian",
    "name": "Ma Fan_"
  },
  "assignee": null,
  "repository": {
    "id": 280713,
    "full_name": "dengmengmian / test01",
    "path": "test01",
    "name": "test01",
    "description": "",
    "created_at": "2024-04-15T16:27:45.090+08:00",
    "updated_at": "2024-04-15T16:27:45.090+08:00",
    "assigner": null,
    "paas": null
  },
  "created_at": "2024-04-15T21:58:21.188+08:00",
  "updated_at": "2024-04-15T21:58:21.188+08:00",
  "finished_at": null,
  "labels": [],
  "priority": null,
  "issue_type": null,
  "issue_state": "opened",
  "issue_state_detail": null,
  "stage": "New",
  "severity": "Major"
}

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credential)
403 Forbidden; you do not have permission to view this issue
404 Request path does not exist or the issue does not exist
405 Unsupported request method
429 Too many requests; rate limit triggered
500 Internal server error

Markdown source: View on AtomGit·Content from the open-source project gitcode-dev/atomgit-api-doc