Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,670
Community Members
 
Community Events
176
Community Groups

API or CLI to access to Repository information within Bamboo Plans

We are looking at extracting the repository information (server, repo, authentication info) for a given Bamboo plan by calling the Bamboo API.

I cannot seem to find any API endpoint on this. I wonder if I miss anything or any thing available through Bamboo CLI.

1 answer

0 votes

Hello @Eddy Siauwidjaja, Welcome to Atlassian Community!

You can do this by querying the database. Though doable through the API, you'll have to run multiple API checks and parse the output multiple times to get to a similar result.

Please check the following KB. The provided queries may require some extension depending on your requirement, but they are already a good start.

 

Regards,

Eduardo Alvarenga
Atlassian Support APAC

Thank you, @Eduardo Alvarenga  - if doable via API, we prefer the API path as we already have other scripts running via API. Could you please share which end point to use? I can't seem to find the one that can return the Plan's repository information.

Secondly, I need to create the repo reference to the new repo via API and map the Plan to the new repo reference as well. are there such API endpoints? 

I noticed this is available through Bamboo CLI plugins. I assume Bamboo CLI will wrap some kind of API behind the scene. I can't seem to find it in the Bamboo's API reference. I must have missed something.

Hello @Eddy Siauwidjaja 

I would use the following endpoints:

  1. Dump the plan as YAML specs:
    1. https://docs.atlassian.com/atlassian-bamboo/REST/8.2.3/#d2e2894
    2. The YAML contents will be on the Json's .spec.code
  2. If the repository is a Plan repository, you will find the details there already
  3. If the repository has a "global" or "project" scope, you will need to get the details on another REST call:
    1. https://docs.atlassian.com/atlassian-bamboo/REST/8.2.3/#d2e4917
    2. You will need to use the searchTerm or you can use an empty searchTerm to return all Linked repositories.
    3. For each Linked repository, access the provided searchResults.url for and parse the HTML output to retrieve the details of it. You can use a tool such as xidel to parse it.

There is no way to make changes to a Plan via the API. You will have to use Bamboo Specs for that.

 

Regards,

Eduardo Alvarenga
Atlassian Support APAC

Thank you again, @Eduardo Alvarenga 

 

Unfortunately, I cannot use any UI - as I have to deal with thousands of plans.

I need an API way to do the above steps. Please share the API endpoints to do the above. 

All the API endpoints are listed in my previous message.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events