首页 > 解决方案 > 有没有办法将分支合并状态信息转换为 JSON?

问题描述

因此,流量大的存储库总是倾向于拥有越来越多的 OPEN、MERGED 和 DECLINED 分支。我们提出了创建一个 Jenkins 作业的想法,该作业可以不时运行以删除开发人员所有已合并和未使用的分支。

生成的 JSON 文件不包含 BRANCH STATUS 的信息。那么有没有办法我可以获得这样的信息,在 isDefault 参数之后的附加键值对就像......

“branchStatus”:已合并/已拒绝/已打开。

{
  "size": 312,
  "limit": 500,
  "isLastPage": true,
  "values": [
    {
      "id": "refs/heads/ODC-2843-DC-Scheduler-Service",
      "displayId": "ODC-2843-DC-Scheduler-Service",
      "type": "BRANCH",
      "latestCommit": "fcb1cd0fec34c3ab7d9539e23e9cefc1b5c5866e",
      "latestChangeset": "fcb1cd0fec34c3ab7d9539e23e9cefc1b5c5866e",
      "isDefault": false
    },
    {
      "id": "refs/heads/master",
      "displayId": "master",
      "type": "BRANCH",
      "latestCommit": "fe3d3c678adb7d1f6c472002ef88dafca3295089",
      "latestChangeset": "fe3d3c678adb7d1f6c472002ef88dafca3295089",
      "isDefault": true
    },
}

标签: jsonrestapibitbucketbitbucket-api

解决方案


推荐阅读