You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何通过GitLab API获取指定审核人的合并请求?

解决GitLab API筛选指定审核人合并请求的问题
  • 正确的查询参数用法:GitLab API的projects/:id/merge_requests端点支持复数形式的参数来筛选审核人:
    • 使用用户ID:用reviewer_ids参数(注意是复数),单个ID直接传值,多个ID用逗号分隔,示例请求:
      https://gitlab.com/api/v4/projects/:id/merge_requests?reviewer_ids=123
      
    • 使用用户名:GitLab 14.0及以上版本支持reviewer_usernames参数,示例请求:
      https://gitlab.com/api/v4/projects/:id/merge_requests?reviewer_usernames=example_user
      
  • 关键注意事项:
    • 旧版本GitLab(低于14.0)不支持reviewer_usernames,只能用reviewer_ids筛选
    • 确认你的API令牌拥有读取目标项目合并请求的权限,权限不足可能返回空数组
    • 验证指定用户确实是目标合并请求的审核人(包括已添加但未完成审核的状态)

内容的提问来源于stack exchange,提问作者Daikozi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.31 19:00:53