Feature Request for POST Webhooks (BB-14409)

Issue #11886 invalid
Benjamin Chen
created an issue

It would be fantastic to have an easier integration into Jenkins. It looks like the current webhook structure just posts a request body of the JSON payload. If we could get the following option instead, it would be super helpful!

  • Set 'Content-Type' header to 'application/x-www-form-urlencoded'
  • Have the request body simply be 'payload=#{standard json webhook payload}

This would allow us to do freeform Jenkins jobs that take action based on the webhook output.

Our current alternative is to use a proxy webapp or to write a new Jenkins plugin.

Comments (14)

  1. Greg Drozd

    Jenkins plugin has nothing to do with that. It will trigger build only after several conditions are meet. I need functioning "Remote trigger" function with paylod in a variable. Please consider implementing this feature.

  2. Niels van Aken

    I want to emphasise that this is an issue, the Jenkins Bitbucket plugin will not fit into some specific workflows. For example, the Bitbucket plugin expects you to be able to predefine the Bitbucket URL, if the triggering remote does not - loosely - match the git remote in Jenkins, it will ignore the webhook being triggered. We too have a setup which requires triggering from a unknown Bitbucket source repository.

    That said, we do need the payload. Since the Remote trigger function (as mentioned by Greg Drozd) does not accept the request body as parameter, we need to parameterise the payload into a form-urlencoded querystring.

  3. Daniel Tao staff

    @Greg Drozd @Niels van Aken Forgive me for being dense, but I don't quite understand what's being requested. Do you want outbound POST requests w/ Content-Type: application/x-www-form-urlencoded and a request body of payload=#{standard json webhook payload}? If so that's what our POST service currently offers. If you want a more robust and feature-rich system I would recommend our newer webhooks. Do neither of these options work for you?

  4. Niels van Aken

    No problem with being "dense". I'd rather have overlooked an already existing feature then waiting for a new one to be developed. 😉

    That's exactly what I need, but that did not seem possible with the current web hooks? And I haven't investigated the POST services a lot since I read that those are being deprecated and the wiki suggests me to use the normal webhook service. Can you provide more information about how I would achieve a &payload=? Since I'm unable to retrieve such information from the Wiki nor the webhook config modal.

    I thank you in advance.

    Edit: Just to make sure we're on the same page: I'm not looking for a payload loose in the request body (as supplied by default in webhooks), but as a parameter (eg. payload={payload}). The latter is the one I cannot seem to supply with the current setup within the Bitbucket webhook system.

  5. Daniel Tao staff

    @Niels van Aken So to be clear you want the payload specified as a query string parameter, in the URL? Unfortunately no, we don't offer any way of doing that. I'm sorry to disappoint, but... I think it's fair to say that's a very unusual requirement?

    Since the original functionality requested in this feature is to provide the option to send url-encoded data in the request body, and that functionality does exist, could you create a new feature request for putting the data in the query string?

  6. Niels van Aken

    @Daniel Tao I think I do indeed need it in the query string, that's the only way to get it into the Jenkins webhook parameters without using the Bitbucket plugin (which fetches it from the body). If you have any suggestions about how I could inject the payload into the parameters otherwise, I'd love to hear your advise.

    About the url-encoded data, I do not think I've been testing with that kind of payload. Can you tell me how I can switch to url-encoded payload?

  7. Log in to comment