Add REST API to get plan repositories

XMLWordPrintable

    • Type: Suggestion
    • Resolution: Unresolved
    • None
    • Component/s: REST API
    • None
    • 1
    • 5

      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

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

              Created:
              Updated: