{{< details >}}

  • Tier: 基础版, 专业版, 旗舰版
  • Offering: JihuLab.com, 私有化部署

{{< /details >}}

每次调用 议题 统计 API 都必须经过认证。

如果用户不是项目的成员并且项目是私有的,那么对该项目进行 GET 请求会返回 404 状态码。

获取议题统计

获取认证用户有权限访问的所有议题的统计数据。默认情况下,它只返回当前用户创建的议题。要获取所有议题,请使用参数 scope=all

GET /issues_statistics
GET /issues_statistics?labels=foo
GET /issues_statistics?labels=foo,bar
GET /issues_statistics?labels=foo,bar&state=opened
GET /issues_statistics?milestone=1.0.0
GET /issues_statistics?milestone=1.0.0&state=opened
GET /issues_statistics?iids[]=42&iids[]=43
GET /issues_statistics?author_id=5
GET /issues_statistics?assignee_id=5
GET /issues_statistics?my_reaction_emoji=star
GET /issues_statistics?search=foo&in=title
GET /issues_statistics?confidential=true
属性 类型 必需 描述
labels string no 以逗号分隔的标签名称列表,议题必须拥有所有标签才能被返回。None 列出所有没有标签的议题。Any 列出至少拥有一个标签的议题。
milestone string no 里程碑标题。None 列出所有没有里程碑的议题。Any 列出所有分配了里程碑的议题。
scope string no 返回给定范围的议题:created_by_meassigned_to_meall。默认是 created_by_me
author_id integer no 返回由给定用户 id 创建的议题。与 author_username 互斥。可以与 scope=allscope=assigned_to_me 结合使用。
author_username string no 返回由给定 username 创建的议题。类似于 author_id,与 author_id 互斥。
assignee_id integer no 返回分配给给定用户 id 的议题。与 assignee_username 互斥。None 返回未分配的议题。Any 返回有分配者的议题。
assignee_username string array no 返回分配给给定 username 的议题。类似于 assignee_id,与 assignee_id 互斥。在极狐GitLab 基础版中,assignee_username 数组应该只包含一个值,否则会返回无效参数错误。
epic_id integer no 返回与给定史诗 ID 相关联的议题。None 返回没有与史诗关联的议题。Any 返回与史诗关联的议题。专业版和旗舰版专有。
my_reaction_emoji string no 返回由认证用户通过给定 emoji 反应的议题。None 返回未给出反应的议题。Any 返回至少给出一个反应的议题。
iids[] integer array no 仅返回拥有给定 iid 的议题
search string no 在议题的 titledescription 中搜索议题
in string no 修改 search 属性的范围。titledescription 或用逗号连接它们的字符串。默认是 title,description
created_after datetime no 返回在给定时间或之后创建的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
created_before datetime no 返回在给定时间或之前创建的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
updated_after datetime no 返回在给定时间或之后更新的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
updated_before datetime no 返回在给定时间或之前更新的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
confidential boolean no 过滤机密或公开的议题。
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/issues_statistics"

示例响应:

{
  "statistics": {
    "counts": {
      "all": 20,
      "closed": 5,
      "opened": 15
    }
  }
}

获取群组议题统计

获取给定群组的议题统计数据。

GET /groups/:id/issues_statistics
GET /groups/:id/issues_statistics?labels=foo
GET /groups/:id/issues_statistics?labels=foo,bar
GET /groups/:id/issues_statistics?labels=foo,bar&state=opened
GET /groups/:id/issues_statistics?milestone=1.0.0
GET /groups/:id/issues_statistics?milestone=1.0.0&state=opened
GET /groups/:id/issues_statistics?iids[]=42&iids[]=43
GET /groups/:id/issues_statistics?search=issue+title+or+description
GET /groups/:id/issues_statistics?author_id=5
GET /groups/:id/issues_statistics?assignee_id=5
GET /groups/:id/issues_statistics?my_reaction_emoji=star
GET /groups/:id/issues_statistics?confidential=true
属性 类型 必需 描述
id integer/string yes 群组的 ID 或 URL 编码的群组路径
labels string no 以逗号分隔的标签名称列表,议题必须拥有所有标签才能被返回。None 列出所有没有标签的议题。Any 列出至少拥有一个标签的议题。
iids[] integer array no 仅返回拥有给定 iid 的议题
milestone string no 里程碑标题。None 列出所有没有里程碑的议题。Any 列出所有分配了里程碑的议题。
scope string no 返回给定范围的议题:created_by_meassigned_to_meall
author_id integer no 返回由给定用户 id 创建的议题。与 author_username 互斥。可以与 scope=allscope=assigned_to_me 结合使用。
author_username string no 返回由给定 username 创建的议题。类似于 author_id,与 author_id 互斥。
assignee_id integer no 返回分配给给定用户 id 的议题。与 assignee_username 互斥。None 返回未分配的议题。Any 返回有分配者的议题。
assignee_username string array no 返回分配给给定 username 的议题。类似于 assignee_id,与 assignee_id 互斥。在极狐GitLab 基础版中,assignee_username 数组应该只包含一个值,否则会返回无效参数错误。
my_reaction_emoji string no 返回由认证用户通过给定 emoji 反应的议题。None 返回未给出反应的议题。Any 返回至少给出一个反应的议题。
search string no 在群组议题的 titledescription 中搜索议题
created_after datetime no 返回在给定时间或之后创建的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
created_before datetime no 返回在给定时间或之前创建的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
updated_after datetime no 返回在给定时间或之后更新的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
updated_before datetime no 返回在给定时间或之前更新的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
confidential boolean no 过滤机密或公开的议题。
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/groups/4/issues_statistics"

示例响应:

{
  "statistics": {
    "counts": {
      "all": 20,
      "closed": 5,
      "opened": 15
    }
  }
}

获取项目议题统计

获取给定项目的议题统计数据。

GET /projects/:id/issues_statistics
GET /projects/:id/issues_statistics?labels=foo
GET /projects/:id/issues_statistics?labels=foo,bar
GET /projects/:id/issues_statistics?labels=foo,bar&state=opened
GET /projects/:id/issues_statistics?milestone=1.0.0
GET /projects/:id/issues_statistics?milestone=1.0.0&state=opened
GET /projects/:id/issues_statistics?iids[]=42&iids[]=43
GET /projects/:id/issues_statistics?search=issue+title+or+description
GET /projects/:id/issues_statistics?author_id=5
GET /projects/:id/issues_statistics?assignee_id=5
GET /projects/:id/issues_statistics?my_reaction_emoji=star
GET /projects/:id/issues_statistics?confidential=true
属性 类型 必需 描述
id integer/string yes 项目的 ID 或 URL 编码的项目路径
iids[] integer array no 仅返回拥有给定 iid 的里程碑
labels string no 以逗号分隔的标签名称列表,议题必须拥有所有标签才能被返回。None 列出所有没有标签的议题。Any 列出至少拥有一个标签的议题。
milestone string no 里程碑标题。None 列出所有没有里程碑的议题。Any 列出所有分配了里程碑的议题。
scope string no 返回给定范围的议题:created_by_meassigned_to_meall
author_id integer no 返回由给定用户 id 创建的议题。与 author_username 互斥。可以与 scope=allscope=assigned_to_me 结合使用。
author_username string no 返回由给定 username 创建的议题。类似于 author_id,与 author_id 互斥。
assignee_id integer no 返回分配给给定用户 id 的议题。与 assignee_username 互斥。None 返回未分配的议题。Any 返回有分配者的议题。
assignee_username string array no 返回分配给给定 username 的议题。类似于 assignee_id,与 assignee_id 互斥。在极狐GitLab 基础版中,assignee_username 数组应该只包含一个值,否则会返回无效参数错误。
my_reaction_emoji string no 返回由认证用户通过给定 emoji 反应的议题。None 返回未给出反应的议题。Any 返回至少给出一个反应的议题。
search string no 在项目议题的 titledescription 中搜索议题
created_after datetime no 返回在给定时间或之后创建的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
created_before datetime no 返回在给定时间或之前创建的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
updated_after datetime no 返回在给定时间或之后更新的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
updated_before datetime no 返回在给定时间或之前更新的议题。期望格式为 ISO 8601 (2019-03-15T08:00:00Z)
confidential boolean no 过滤机密或公开的议题。
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/4/issues_statistics"

示例响应:

{
  "statistics": {
    "counts": {
      "all": 20,
      "closed": 5,
      "opened": 15
    }
  }
}