Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-25891

Add REST API to get plan repositories

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • REST API
    • None
    • 1
    • 5
    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      Problem Definition

      Currently there's no REST API to retrieve plan repositories.

      Suggested Solution

      Add a REST API to get plan repositories.

      Workaround

      Export the plan as YAML specs via the Specs API and consume the YAML output. There are different types of Repositories (Plan/Project/Global(Linked) so you will have to plan with a combination of jq and yq or other JSON/YAML parser to get there. For example, you can use jq and yq in the piped sequence to get the information from the Specs API:

      curl -s -k -X GET -H 'Accept: application/json' -H 'Authorization: Bearer <put your personal token here>' "https://bamboo.mydomain.net/rest/api/latest/plan/PROJ-PLAN/specs?format=YAML" | jq -r '.spec.code' | yq e '.repositories[] | keys | .[]'
      

      The curl command above will return something like this:

      repository1
      repository2
      repository3

              Unassigned Unassigned
              kmiranda Karel Miranda
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: