# Get destination branch from bitbucket webhook

**URL:** <https://discuss.bitrise.io/t/get-destination-branch-from-bitbucket-webhook/5769>\
**Category:** Question & Answer\
**Created:** [July 30, 2018, 3:11pm UTC](https://discuss.bitrise.io/t/get-destination-branch-from-bitbucket-webhook/5769 "2018-07-30T15:11:18Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![selcukkizilkaya](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@selcukkizilkaya](https://discuss.bitrise.io/u/selcukkizilkaya)\
**Post date:** [July 30, 2018, 3:11pm UTC](https://discuss.bitrise.io/t/get-destination-branch-from-bitbucket-webhook/5769/1 "2018-07-30T15:11:18Z")

</div>

Hello,

I use bitbucket webhook to start my builds. I can see more information when when i check the request which sends by bitbucket. Is there anyway to access and get some data like destination branch, pull request id from bitbucket’s request?

Thank you!

---

<div class="post-metadata">

**Author:** ![bitce](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bitce/32/1639_2.png) [@bitce](https://discuss.bitrise.io/u/bitce)\
**Post date:** [July 31, 2018, 3:02pm UTC](https://discuss.bitrise.io/t/get-destination-branch-from-bitbucket-webhook/5769/2 "2018-07-31T15:02:43Z")

</div>

Hi @selcukkizilkaya!

If I understand you correctly, you are looking to receive more information from the requests you receive from Bitbucket. That is up to Bitbucket mostly 🙂

I believe you could do that by formatting the HTTP response of the requests, please check out [Bitbuckets example guide](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/hooks#post) and list of available [Event Payloads](https://confluence.atlassian.com/bitbucket/event-payloads-740262817.html#EventPayloads-Issueevents).

I hope this helps, let us know how it goes!

---

<div class="post-metadata">

**Author:** ![selcukkizilkaya](https://avatars.discourse-cdn.com/v4/letter/s/898d66/32.png) [@selcukkizilkaya](https://discuss.bitrise.io/u/selcukkizilkaya)\
**Post date:** [August 6, 2018, 11:28am UTC](https://discuss.bitrise.io/t/get-destination-branch-from-bitbucket-webhook/5769/3 "2018-08-06T11:28:56Z")

</div>

> [@bitce](#):
>
> Bitbuckets example guide

Hello,

Thanks for your answer!

The thing is we use bitbucket on demand. So i have no chance to add new parameters to the webhook. I need basic informations like base branch or pr url which already in the outgoing hook request. What i want to know is, is there anyway to reach bitbucket request from Bitrise.

---

<div class="post-metadata">

**Author:** ![bitce](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/bitce/32/1639_2.png) [@bitce](https://discuss.bitrise.io/u/bitce)\
**Post date:** [August 6, 2018, 1:49pm UTC](https://discuss.bitrise.io/t/get-destination-branch-from-bitbucket-webhook/5769/4 "2018-08-06T13:49:10Z")

</div>

Hey again!

Oh I see what you mean. You could extract this information through environment variables!  
These are what seem to be mostly of importance to you:

 ![26](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/5/52914fc7712940593f1bb7ecf50d83503f802799.png)  
But [here you can find a complete list of environment variables](https://devcenter.bitrise.io/builds/available-environment-variables/) available.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [September 5, 2018, 1:49pm UTC](https://discuss.bitrise.io/t/get-destination-branch-from-bitbucket-webhook/5769/5 "2018-09-05T13:49:13Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
