0

So a Repository having heavy traffic always tends to be having more and more OPEN, MERGED and DECLINED branches. We came up with this idea of creating a Jenkins Job which could be run once in a while to DELETE all the MERGED and unused branches by the Developer.

The JSON file which is getting generated does not contain the information of BRANCH STATUS. So is there a way i can get such information, an additional key value pair after the isDefault parameter just like ...

"branchStatus" : MERGED/DECLINED/OPEN .

{
  "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
    },
}
  • Can you edit your question to be more obvious? I think something like "Is there a way to get branch merge status information into JSON" or something similar. More information about how you're getting the JSON in the first place would be useful too. – bob0the0mighty Apr 01 '20 at 12:59
  • @bob0the0mighty I am just adding the **"/rest/api/1.0/"** in a link for example [https://example.com/projects/HELM/repos/charts/branches] to [https://example.com/rest/api/1.0/projects/HELM/repos/charts/branches] and a JSON File is getting generated. – Nishaaaaaant Apr 02 '20 at 05:36
  • @bob0the0mighty i'm waiting for your reply – Nishaaaaaant Apr 06 '20 at 09:23
  • I was asking a clarifying question so your question would have a better chance of being answered. I'm not sure how to help you otherwise as I don't use bitbucket, which I assume is creating the json file. – bob0the0mighty Apr 08 '20 at 19:17

0 Answers0