Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bitbucket pull request updated webhook

Right now using the webhook pull request updated event I get notified for any pull request update (eg: description updated, title changed, etc.)

Is there a way to be notified only when a push was made to a pull request?

like image 648
daniels Avatar asked Oct 23 '25 15:10

daniels


1 Answers

No, the webhook will be triggered each time something changes in a pull request.

However, looking at the payload that you will get with a pullrequest:updated webhook, you could build that logic yourself, by comparing the source commit hash with a previously (stored) hash. If they are different, it means that a push was made.

Payload snippet:

{
   "id" :  1 ,
   "title" :  "Title of pull request" ,
   "description" :  "Description of pull request" ,
   "state" :  "OPEN|MERGED|DECLINED" ,
   "author" : User,
   "source" : {
    "branch" : {  "name" :  "branch2" },
    "commit" : {  "hash" :  "d3022fc0ca3d" },
    "repository" : Repository
   }
}
like image 118
Alexandru Guzinschi Avatar answered Oct 25 '25 16:10

Alexandru Guzinschi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!