Where can I find documentation for Bamboo's remote trigger API?
Asked by Jason Pike:

I just used an Atlassian [article](https://confluence.atlassian.com/bamkb/how-to-trigger-a-bamboo-build-from-bitbucket-cloud-using-a-webhook-872271665.html)to configure my team's integration between BitBucket Cloud and Bamboo Server. I would like to understand the API better, but I can't locate the documentation. Specifically, I want to know:

* What does the skipBranches flag do?
* What other parameters are available?

I expected to find it here: <https://docs.atlassian.com/atlassian-bamboo/REST/6.2.3/>

**BAMBOO_URL** /rest/triggers/1.0/remote/changeDetection?planKey=**PLAN_KEY** \&skipBranches=false


Answers:
author: rsperafico
body: Hello Jason,

The endpoint is not available in Bamboo's REST API documentation, I am afraid. Now, going back to your inquire:

* What does the skipBranches flag do?  
  By default, the change detection will run for all branches. If this parameter is set to true, the change detection will run only for the chain
* What other parameters are available?  
  planKey and skipBranches are the only parameters available

Kind regards,

Rafael


author: Przemek Bruski
body: Although we don't generate documentation to that REST endpoint, it's officially supported and should be used for integration. See Rafael's answer for explanation of the parameters.

comments: author: Timothy_Harris
body: So, using BitBucket cloud and Bamboo Server 6.2.2 how do I accomplish the following?

1. PLAN-A - Want to check that the feature branch merges cleanly and do some basic checks.

* A pull request is **opened**.
* Bitbucket sends a trigger to Bamboo with a Web Hook.
* Bamboo merges the two branches. This is to ensure that the changes merge cleanly.
* Some tasks are executed, compile, unit test, etc and the plan completes and is shown on the pull request.
* Every time a new change is added to the pull request the web hook is sent and the Bamboo plan repeats the process.

2. PLAN-B - Merge the change into the target branch(develop) of the pull request and do some more extensive checks before pushing merge back to BitBucket and thus closing the pull request. .

* A pull request is **approved**.
* Bitbucket sends a trigger to Bamboo with a Web Hook.
* Bamboo merges the feature branch into the target branch of the pull request(develop).
* Some more extensive checks are done, compile, unit test, integration tests, maybe a deployment to an environment and some smoke tests.
* On success the merge is pushed back to BitBucket which closes pull request.

This seems like it should be a pretty straight forward process. BUT....

I configured a webhook for PLAN-A which is sent on pull request creation and updates.
> https://MY_BAMBOO/rest/triggers/1.0/remote/changeDetection?planKey=MY-KEY\&skipBranches=false

In PLAN-A I set the trigger to be remote. The job is triggered but nothing will be built as the linked repository defaults to develop. So change detection will say there is nothing to do unless I can somehow get a hold of the feature branch.

So I configured PLAN-A to create branches on **pull request creation** and configured it to use a Branch Updater strategy.

The trigger is sent, PLAN-A checks for changes on the default branch(develop) for the linked repository and does nothing. But a branch is created for PLAN-A. This does detect changes. This seems to work.

For PLAN-B I create basically the same webhook but only send it when a pull request is approved to PLAN-B.

The same thing will happen with change detection, i.e, it will check if there are changes on the default branch for the linked repository (develop). Let's say there are none. Now the pull request **will not** be merged into develop :-(

So I then I wanted configure branches for PLAN-B. So I select create branch when **pull request is created.** OK this basically the same as Plan-A and should work. When the plan is triggered is doesn't do anything if there are no new changes on the develop branch. But it should see that there is a pull request created? Or what?

Also If I select create branch when pull request is created i **cannot** use the Gatekeeper branching strategy! It is simply not available!

So I am really trying to figure out how to handle this...

Any suggestions would be appreciated.


author: Timothy_Harris
body: To be honest, it all seems a little hopeless without being able to trigger a plan with **at** **least** the branch to check out...

If we could do that then we could at least do some work from the shell with Git.


author: somethingblue
body: Hi Jason,

I checked with the Bamboo team and it doesn't look like there is any public documentation for the Remote Trigger API as it's not public and isn't meant to be used in API calls at this time as all the publicly documented API calls can be found in the document you linked to.

I would encourage you to go to [JAC](https://jira.atlassian.com/secure/BrowseProjects.jspa?selectedCategory=all&selectedProjectType=all) and create a ***Suggestion*** ticket to get this added to the public API and documentation created for it.

Cheers,

Branden