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

Bitbucket webhooks with custom payload?

Charlie Misonne
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 15, 2024

I need to execute a http request when a pull request in created in Bitbucket DC. The request will be received by an external application.

This can be done with the webhooks feature but I do not see any way to define a custom json payload. Bitbucket will always send it's own predefined JSON. Is that correct?

If that's really the case the only way to use the webhooks is when your target application expects that exact format?

 

1 answer

1 vote
Aron Gombas _Midori_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
February 16, 2024

I don't think you can customize the payload.

Instead you could try one of these:

  1. Implement a little "proxy" in between Bitbucket and target system. This proxy would receive the built-in webhook's payload, and transform it to the "dialect" expected by the target system. There are many ways to build something like this, but it can only be done if the built-in payload carries every piece of information that the target system expects.
  2. I think you can have automation rules triggered by the "pull request created" event. If so, then you can use Send web request automation action to send a request to the target system. This action allows customizing the request body, so it could work with your target system, too.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events