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,461,953
Community Members
 
Community Events
176
Community Groups

REST api to delete plan branch

Is there any rest api available to delete plan branches. I am currently using a post to 

'http://<url>/chain/admin/deleteChain!doDelete.action?buildKey=<branchkey>'

It is working fine in version 6.0.3 but not in version 6.6.3 ?

1 answer

Hi @robin ,

https://jira.atlassian.com/browse/BAM-18589 - REST API to Delete plan branches, it became available in Bamboo v6.8.0

http://myhost.com:8085/rest/api/latest/plan/{projectKey}-{buildKey} [GET, DELETE]

More information in https://docs.atlassian.com/atlassian-bamboo/REST/6.8.0/ - Bamboo REST API Documentation

Kind regards,
Rafael

Hi @robin ,

Using the endpoint you have mentioned, you are simply calling the action to confirm your deletion. Instead, you should call:

# http://localhost:8085/bamboo is Bamboo's Base URL

http://localhost:8085/bamboo/ajax/deleteChain.action

The cURL command would be:

# USERNAME, provide username and password to authenticate in Bamboo
# user MUST have permissions over the Plan to perform deletion

# PROJ-PLAN0, example of a Plan branch to be deleted

# http://localhost:8085/bamboo is Bamboo's Base URL
curl -k -u USERNAME \
-H 'X-Atlassian-Token: no-check' \
--data 'buildKey=PROJ-PLAN0' \
-X POST http://localhost:8085/bamboo/ajax/deleteChain.action

Kind regards,
Rafael

Thanks @Rafael Pinto Sperafico  for your reply :) 

My bamboo version is 6.6.3.

I am getting an error 

<h1>Page not found</h1>
<p>
Sorry, the page you were trying to reach does not exist. Try going back to the dashboard and browse the site to find the page you were looking for. </p>
<h4>Go to...</h4>
<ul>
<li><a href="/">Site homepage</a></li>
</ul>

while using the curl 'http://localhost:8085/bamboo/ajax/deleteChain.action'

Is this applicable for my Bamboo version 6.6.3

Regards,

Robin

Hi @robin ,

Could you please confirm http://localhost:8085/bamboo is your Bamboo's Base URL? If not, replace it with your Bamboo's Base URL.

curl -k -u admin:admin \
    -H 'X-Atlassian-Token: no-check' \
    --data 'buildKey=PROJ-PLAN0' \
    -X POST http://bamboo.base.url/ajax/deleteChain.action

{"status":"OK","plan":{"key":"PROJ-PLAN0"}}

Yes, it works on Bamboo 6.6.3

Kind regards,
Rafael
  

Thanks a lot :) @Rafael Pinto Sperafico !!!

That was the issue, I thought '/bamboo/' is a part of api. Now it is working fine... :)

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events