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

Is there a way to create a webhook for pullrequest : merge through bitbucket cloud rest API ?

Bitbucket user February 11, 2020

I can create a webhook manually for 'pullrequest:merged' using Bitbucket cloud console but when I try the same using Bitbucket cloud rest API it gives event not found error

$ curl -X POST -u credentials -H 'Content-Type: application/json'           https://api.bitbucket.org/2.0/repositories/username/slug/hooks           -d '
    {
      "description": "Webhook Description",
      "url": "https://example.com/",
      "active": true,
      "events": [
        "pullrequest:merged"
      ]
    }'
l
>> {"type": "error", "error": {"fields": {"events": ["\"pullrequest:merged\" is not a valid hook event"]}, "message": "Bad request"}}

 

1 answer

0 votes
Bitbucket user February 12, 2020

Resolved it. I had to use "pullrequest:fulfilled" instead of  "pullrequest:merged".....

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events