使用Bitbucket Cloud Webhooks发送PR ID和其他信息

时间:2019-05-15 00:21:01

标签: bitbucket bitbucket-cloud

我正在寻找Bitbucket Cloud 的Webhooks文档: https://confluence.atlassian.com/bitbucket/manage-webhooks-735643732.html

我可以将GET请求发送到url字段中的url,但是我想发送更改的分支的提交或PR id,以便可以将请求发送回Bitbucket以更新Bitbucket的UI。有没有办法在webhooks表单的url字段中包含动态值?

1 个答案:

答案 0 :(得分:0)

Bitbucket将在请求正文(而不是查询参数)中为您发送信息,如下所示:

 { push: { changes: [ [Object] ] },
  actor: 
   { username: 'ntrs_oleg',
     display_name: 'Foo',
     uuid: '{c0e09bb2-26e-f89afe7b1b2c}',
     links: { self: [Object], html: [Object], avatar: [Object] },
     nickname: 'interos_alex',
     type: 'user',
     account_id: '5cc0db15c66f0ffe44c597' },
  repository: 
   { scm: 'git',
     website: '',
     name: 'jenkins-jobs',
     links: { self: [Object], html: [Object], avatar: [Object] },
     project: 
      { key: 'DEVOPS',
        type: 'project',
        uuid: '{2dc188bd997eaa244d9}',
        links: [Object],
        name: 'devops' },
     full_name: 'interos/jenkins-jobs',
     owner: 
      { username: 'interos',
        display_name: 'Interos',
        type: 'team',
        uuid: '{d4ee7ec3-04fce894572}',
        links: [Object] },
     type: 'repository',
     is_private: true,
     uuid: '{4c6795ff-362eb64d935b9}' } }