Skip to content

Get a specific Issue of an enterprise

GET /api/v5/enterprises/{enterprise}/issues/{number}

This endpoint retrieves a specified Issue under an enterprise and returns its details, including the title, content, state, labels, comment count, priority, type, creator, repository, 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
enterprise path string Yes Address path of the namespace that owns the repository (the address path of an organization or individual)
number path integer Yes Globally unique Issue ID
access_token query string No User authorization code

Response parameters

Field Type Always returned Nullable Description
id integer Yes — Globally unique Issue ID
html_url string Yes — HTML address of the Issue
number string Yes — Issue number (a string in the response)
state string Yes — Issue state
title string Yes — Issue title
body string Yes — Issue content
user object Yes — Creator information
repository object Yes — Repository information
created_at string Yes — Creation time
updated_at string Yes — Update time
finished_at string Yes — Completion time, which may be an empty string
labels array Yes — Label list
issue_state string Yes — Issue state name
comments integer Yes — Comment count
priority integer Yes — Priority
issue_type string Yes — Issue type
issue_state_detail object Yes — Issue state details
issue_type_detail object Yes — Issue type details
issue_priority_detail object No — Issue priority details
custom_fields array No — Custom field information
visibility_reason string No — Visibility reason

user object

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

repository object

Field Type Always returned Nullable Description
repository.id integer Yes — Repository ID
repository.full_name string Yes — Full repository name (namespace/repository name)
repository.path string Yes — Repository path
repository.name string Yes — Repository name
repository.description string Yes — Repository description
repository.created_at string Yes — Repository creation time
repository.updated_at string Yes — Repository update time
repository.assigner object Yes — Assigner information, which may be an empty object {}
repository.paas string Yes — Hosting platform information, which may be an empty string

labels array elements

Field Type Always returned Nullable Description
labels.id integer Yes — Label ID
labels.name string Yes — Label name
labels.color string Yes — Label color
labels.created_at string Yes — Label creation time
labels.updated_at string Yes — Label addition time

issue_state_detail object

Field Type Always returned Nullable Description
issue_state_detail.title string Yes — State name
issue_state_detail.serial integer Yes — State sort number
issue_state_detail.id integer Yes — State ID

issue_type_detail object

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

issue_priority_detail object

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

custom_fields array elements

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

Note: Meaning of the visibility_reason values: public means publicly visible; confidential means private and visible only to project members; other means visible only to project members for other reasons.

Error responses

400 Invalid parameters

{
  "error": "invalid_request",
  "message": "Invalid parameters"
}

401 Unauthenticated

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

404 Resource not found

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

The specific field names in error responses are subject to the actual backend response.

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 <enterprise> with the address path of the namespace that owns the repository (the address path of an enterprise, organization, or individual);
  • replace <number> with the globally unique Issue ID;
  • this endpoint allows anonymous access, so no access token is required; if authentication is needed, you can append the optional query parameter access_token=<token>.

cURL

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

JavaScript

const response = await fetch("https://api.atomgit.com/api/v5/enterprises/<enterprise>/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/enterprises/<enterprise>/issues/<number>",
    headers={
        "Accept": "application/json",
    },
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

{
  "id": 471521,
  "html_url": "https://api.atomgit.com/owner-test/wonderful1/issues/1",
  "number": "1",
  "state": "open",
  "title": "bbbbb",
  "body": "sdfsdf",
  "user": {
    "avatar_url": "https://api.atomgit.com/csdn_fenglh/avatar",
    "html_url": "https://api.atomgit.com/csdn_fenglh",
    "id": "654c61e5560ed95fd216cf31",
    "login": "csdn_fenglh",
    "name": "fenglh"
  },
  "repository": {
    "id": 686738,
    "full_name": "owner-test/wonderful1",
    "path": "wonderful1",
    "name": "wonderful1",
    "description": "My test code repository",
    "created_at": "2024-10-16T15:51:35+08:00",
    "updated_at": "2024-10-16T15:51:35+08:00",
    "assigner": {},
    "paas": ""
  },
  "created_at": "2024-12-10T16:02:12+08:00",
  "updated_at": "2024-12-10T16:02:21+08:00",
  "finished_at": "",
  "labels": [],
  "issue_state": "To do",
  "comments": 0,
  "priority": 0,
  "issue_type": "bug",
  "issue_state_detail": {
    "title": "To do",
    "serial": 0,
    "id": 1
  },
  "issue_type_detail": {
    "title": "Bug",
    "id": 1,
    "is_system": true
  },
  "issue_priority_detail": {
    "id": "1",
    "title": "High"
  },
  "custom_fields": [
    {
      "field_name": "module",
      "field_type": "text_single",
      "field_visibility": "1",
      "field_values": ["Login"]
    }
  ],
  "visibility_reason": "public"
}

Error codes

Error code Description
400 Invalid parameters or unparsable request
401 Unauthenticated or invalid credentials (missing or invalid access credential)
403 Forbidden; no permission
404 Request path does not exist or resource does not exist
405 Request method not allowed
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