Skip to content

Get the operation logs of an issue

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

Retrieves the operation logs of an issue, returning the list of operation records for the issue, listing the operation content, operator, and associated merge request information in chronological order.

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)
number path string Yes Issue number (must be a positive integer)
repo query string Yes Repository path (path)
sort query string No Sort order; values are desc / asc, defaulting to desc

Response parameters

Returns an array of operation log objects (array<object>), each element corresponding to one operation record.

Field Type Always returned Nullable Description
id integer Yes Yes Operation log ID
user object Yes Yes Operator user information; may be null
content string Yes Yes Operation content
created_at string Yes Yes Creation time
action_type string Yes Yes Operation type (such as add_issue_mr_link, milestone, and so on)
update_at string Yes Yes Update time
title string Yes Yes Title (the associated merge request title when applicable; may be null)
body string Yes Yes Description (the associated merge request description when applicable; may be null)
head object Yes Yes Source branch information (returned for an associated merge request; may be null)
base object Yes Yes Target branch information (returned for an associated merge request; may be null)
issue_id string Yes Yes Issue ID

user object

Field Type Always returned Nullable Description
user.avatar_url string Yes Yes Avatar URL
user.events_url string Yes Yes Events URL; may be null
user.followers_url string Yes Yes Followers URL; may be null
user.following_url string Yes Yes Following URL; may be null
user.gists_url string Yes Yes Gist URL; may be null
user.html_url string Yes Yes Profile page URL
user.id string Yes Yes User ID
user.login string Yes Yes Login name
user.member_role string Yes Yes Member role; may be null
user.name string Yes Yes Username
user.organizations_url string Yes Yes Organizations URL; may be null
user.received_events_url string Yes Yes Received events URL; may be null
user.remark string Yes Yes Enterprise remark name; may be null
user.repos_url string Yes Yes Repository URL; may be null
user.starred_url string Yes Yes Starred URL; may be null
user.subscriptions_url string Yes Yes Subscriptions URL; may be null
user.type string Yes Yes User type; may be null
user.url string Yes Yes User URL; may be null

head object

Field Type Always returned Nullable Description
head.ref string Yes Yes Source branch name
head.sha string Yes Yes Source branch commit SHA
head.repo object Yes Yes Source repository information
head.assigner object Yes Yes Assignee information; may be null

head.repo object

Field Type Always returned Nullable Description
head.repo.path string Yes Yes Repository path (path)
head.repo.name string Yes Yes Repository name

head.assigner object

Field Type Always returned Nullable Description
head.assigner.login string Yes Yes Assignee login name
head.assigner.name string Yes Yes Assignee username

base object

Field Type Always returned Nullable Description
base.ref string Yes Yes Target branch name
base.sha string Yes Yes Target branch commit SHA
base.repo object Yes Yes Target repository information
base.assigner object Yes Yes Assignee information; may be null

base.repo object

Field Type Always returned Nullable Description
base.repo.path string Yes Yes Repository path (path)
base.repo.name string Yes Yes Repository name

Error responses

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

400 Parameter error

{
  "error": "invalid_request",
  "message": "The number parameter must be a positive integer",
  "field": "number"
}

401 Unauthenticated

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

HTTP status codes

Status code Description
200 Success (OK)
400 Parameter error
401 Requires authentication (Requires authentication)
403 Forbidden (Forbidden)
404 Request path does not exist
500 Internal server error

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 <number> with the issue number;
  • replace <repo> with the repository path (path);
  • replace <token> with your AtomGit user access token (optional for anonymous access).

cURL

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

JavaScript

// Native fetch (Node.js 18+ / browsers)
const response = await fetch(
  "https://api.atomgit.com/api/v5/repos/<owner>/issues/<number>/operate_logs?repo=<repo>",
  {
    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>/issues/<number>/operate_logs",
    params={"repo": "<repo>"},
    headers={"Accept": "application/json"},
    timeout=10,
)
resp.raise_for_status()

print(resp.json())

Response example

Status code: 200

[
  {
    "id": 272199,
    "user": {
      "avatar_url": "https://api.atomgit.com/avatar.png",
      "html_url": "https://api.atomgit.com/dengmengmian",
      "id": "661ce4eab470b1430d456154",
      "login": "dengmengmian",
      "name": "Ma Fan_"
    },
    "content": "Create issue mr links: **new: added file 1.text** #1",
    "created_at": "2024-04-20T15:20:24.009+08:00",
    "action_type": "add_issue_mr_link",
    "update_at": "2024-04-20T15:20:24.009+08:00",
    "title": "new: added file 1.text",
    "body": "new: added file 1.text ",
    "head": {
      "ref": "develop",
      "sha": "dd954d3a779edc86dae5b4b60c7f24dd0f195bf4",
      "repo": {
        "path": "test01",
        "name": "test01"
      },
      "assigner": {
        "login": "dengmengmian",
        "name": "Ma Fan_"
      }
    },
    "base": {
      "ref": "main",
      "sha": "32cff0d8faaa0c044d0f94957e656051986e8403",
      "repo": {
        "path": "test01",
        "name": "test01"
      },
      "assigner": null
    },
    "issue_id": "152642"
  }
]

Error codes

Error code Description
401 Unauthenticated or invalid credentials (missing or invalid access credential)
400 Invalid parameters or unparsable request
404 Request path does not exist
405 Unsupported request method
429 Too many requests; rate limit triggered
500 Internal server error

OpenAPI

{"paths": {"/api/v5/repos/{owner}/issues/{number}/operate_logs": {"get": {"tags": ["issues"], "summary": "Get the operation logs of an issue", "responses": {"200": {"content": {"application/json": {"schema": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "integer", "description": "Operation log ID"}, "base": {"type": "object", "properties": {"ref": {"type": "string", "description": "Target branch name"}, "sha": {"type": "string", "description": "Target branch commit SHA"}, "repo": {"type": "object", "properties": {"name": {"type": "string", "description": "Repository name"}, "path": {"type": "string", "description": "Repository path (path)"}}, "description": "Target repository information"}, "assigner": {"type": "object", "properties": {"name": {"type": "string", "description": "Assignee username"}, "login": {"type": "string", "description": "Assignee login name"}}, "description": "Assignee information"}}, "description": "Target branch information"}, "body": {"type": "string", "description": "Description"}, "head": {"type": "object", "properties": {"ref": {"type": "string", "description": "Source branch name"}, "sha": {"type": "string", "description": "Source branch commit SHA"}, "repo": {"type": "object", "properties": {"name": {"type": "string", "description": "Repository name"}, "path": {"type": "string", "description": "Repository path (path)"}}, "description": "Source repository information"}, "assigner": {"type": "object", "properties": {"name": {"type": "string", "description": "Assignee username"}, "login": {"type": "string", "description": "Assignee login name"}}, "description": "Assignee information"}}, "description": "Source branch information"}, "user": {"type": "object", "properties": {"id": {"type": "string", "description": "User ID"}, "url": {"type": "string", "description": "User URL"}, "name": {"type": "string", "description": "Username"}, "type": {"type": "string", "description": "User type"}, "login": {"type": "string", "description": "Login name"}, "remark": {"type": "string", "description": "Enterprise remark name"}, "html_url": {"type": "string", "description": "Profile page URL"}, "gists_url": {"type": "string", "description": "Gist URL"}, "repos_url": {"type": "string", "description": "Repository URL"}, "avatar_url": {"type": "string", "description": "Avatar URL"}, "events_url": {"type": "string", "description": "Events URL"}, "member_role": {"type": "string", "description": "Member role"}, "starred_url": {"type": "string", "description": "Starred URL"}, "followers_url": {"type": "string", "description": "Followers URL"}, "following_url": {"type": "string", "description": "Following URL"}, "organizations_url": {"type": "string", "description": "Organizations URL"}, "subscriptions_url": {"type": "string", "description": "Subscriptions URL"}, "received_events_url": {"type": "string", "description": "Received events URL"}}, "description": "Operator user information"}, "content": {"type": "string", "description": "Operation content"}, "created_at": {"type": "string", "description": "Creation time"}, "action_type": {"type": "string", "description": "Operation type"}, "update_at": {"type": "string", "description": "Update time"}, "title": {"type": "string", "description": "Title"}, "issue_id": {"type": "string", "description": "Issue ID"}}}}, "description": "Success"}}, "parameters": [{"in": "path", "name": "owner", "schema": {"type": "string"}, "required": true, "description": "Address path of the namespace that owns the repository (the address path of an enterprise, organization, or individual)"}, {"in": "path", "name": "number", "schema": {"type": "string"}, "required": true, "description": "Issue number (must be a positive integer)"}, {"in": "query", "name": "repo", "schema": {"type": "string"}, "required": true, "description": "Repository path (path)"}, {"in": "query", "name": "sort", "schema": {"type": "string"}, "required": false, "description": "Sort order; values are desc / asc, defaulting to desc"}], "description": "Call this endpoint to get the operation logs of an issue."}}}}

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