mohamicorp / stash-jenkins-postreceive-webhook

Webhook used to notify Jenkins when commits are made to Stash
Other
138 stars 100 forks source link

Programmatically add a second JenkinsBase to a stash webhook #208

Open SDanS opened 6 years ago

SDanS commented 6 years ago

We are currently able to programatically add a jenkins webhook to our bitbucket repos. However, we need to add a second jenkins instance to it. Long story short, the api endpoint we are hitting is like this:

https://my.bitbucket.server/rest/api/1.0/projects/someproject/repos/fake-project/settings/hooks/com.nerdwin15.stash-stash-webhook-jenkins:jenkinsPostReceiveHook/enabled

We're using the PUT method.

The data we're passing is like the following:

'{"jenkinsBase":"https://dans.com/","cloneType":"ssh","ignoreCerts":false}

If I add a second jenkinsBase to the data structure above like the following, it only accepts the second value:

'{"jenkinsBase":"https://dans.com/","cloneType":"ssh","ignoreCerts":false,"jenkinsBase":"https://dans1.com","cloneType":"ssh","ignoreCerts":false}'

What method and data structure should I use to add a second jenkinsBase to our webhook for a repo?