Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trigger bamboo from bitbucket Webhooks

Hi guys,

I spent a couple of hours to figure out why I'm not able to trigger a webhook from bitbucket to bamboo,  I found nothing yet 

Issue:
I want to detect when a PR is merged or a branch is deleted which as I see I'm not able to track these need from bamboo, so I need to have a webhook in bitbucket and call a bamboo reset api  base on this page
https://confluence.atlassian.com/bamboo/triggering-a-bamboo-build-from-bitbucket-cloud-using-webhooks-873949130.html

But this solution is now working because each time I got this error message

{"message":"Anonymous user can't access this resource. If it should be available, modify anonymous user permissions at Administration > Security settings","status-code":401}

 
The only access we have for Anonymous group is view which I see this is not enough to call this API from bitbucket
https://confluence.atlassian.com/bamboo/bamboo-permissions-369296034.html



So I don't know what to do and how to track if a PR is merged or a branch is deleted.

I would appreciate to tell me what the problem is


FYI: bamboo and bitbucket version is the latest one

1 answer

1 accepted

1 vote
Answer accepted

Hi @Hamed Beiranvand

To allow an anonymous user to trigger change detection you need to enable the following security option:

  • Admin >> Security settings >> [ ]Allow anonymous users to trigger remote repository change detection and Bamboo Specs detection

Your instance should be able to get the branch deletion even if there is no webhook configured. Bamboo has a feature for that. The branch detection feature is enabled by default and has the check interval configured in:

  • Admin >> General configuration >> Branch detection interval

Let me know if after configuring the security property you get it working.

@Daniel Santos Thank you for your reply. I really appreciate it.


About anonymous user, I think it's not a good idea in security perspective because it will enable the public to trigger the plan.


And about the branch deletion, I do not know the way to trigger a plan when a branch is deleted.


let me tell you what I want to do, for each PR a new environment would be created which it's supposed to be deleted when the PR is merged or deleted.

So I created a new plan for this case, but I need to trigger it when the PR is merged or deleted.

Hi @Hamed Beiranvand

I'm not sure if I really understood you from the beginning.

About anonymous user, I think it's not a good idea in security perspective because it will enable the public to trigger the plan.

It would not be free to everyone. Only the IPs configured in the repository trigger will be able to use the resource, but I understand your concern.


And about the branch deletion, I do not know the way to trigger a plan when a branch is deleted.

If I understand you correctly you are trying run a build to check the changes of a pull request, is that correct? I think I didn't get that from the first message.

Have you tried the Plan configuration >> Branches >> When pull request is created configuration?

let me tell you what I want to do, for each PR a new environment would be created which it's supposed to be deleted when the PR is merged or deleted.

So I created a new plan for this case, but I need to trigger it when the PR is merged or deleted.

 Please check that configuration. It should work for what you need.

I already know about this part

 

Plan configuration >> Branches >> When pull request

 

and about 

 


It would not be free to everyone. Only the IPs configured in the repository trigger will be able to use the resource

 


we do not allow to this solution for security stuff 


but anyway I really appreciate for your time to spent to answer my question

Hi @Hamed Beiranvand

sorry about the late reply, but I have a question for you.

  • Have you tried adding user and password in your request URL in bitbucket webhook?
    It would be something like:
    https://<USER>:<PASSWROD>@BAMBOO_URL/rest/triggers/1.0/remote/changeDetection?planKey=PLAN-KEY&skipBranches=false

I just wanted to make sure you tried this option before giving up.
Let me know if that is an option to move forward.

Hello @Daniel Santos , It seems that I have same issue, I can't trigger bamboo plan using Bitbucket webhook, I tried your last suggestion:  

/<USER>:<PASSWROD>@BAMBOO_URL

 But unfortunately it not helped

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bamboo

Bamboo 101 Video

G’day Community! As we gear up to introduce Bamboo Data Center to the world, we wanted to make sure that we shared a bit more about Bamboo, the product. Our team has put together an overview video ...

215 views 4 6
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you