Automating creation of webhooks, and issues with build-type id

I am trying to automate creation of webhooks in TC 9.0.1, but I am running into various problems..

  1. The obvious way to do this would be through the REST api, but I haven't been able to find support for creating webhooks through the api. Is it possible?
  2. Made a Powershell script to generate webhooks file (plugin-settings.xml). However to to make the webhook private to each build configuration, I need the build-type id. I thought this was the Build Configuration ID, but obviously not. This is some internal id on the form btxxx where xxx is a number. Where can I find this id, and why is this id different from the Build Configuration ID??



Rgds,
Nils Magne Lunde

3 comments
Comment actions Permalink

Hi Nils,

Please try the third party tcWebHooks plugin.
Build configuration has multiple ids: btxxx is used internally and Build Configuration ID is used (since TC 7) in links, REST API and so on. Please explain why do you need build type id?

0
Comment actions Permalink

Hi

We are already using the tcWebHooks plugin, and it is working great.
However we would like to automate the setup of webhooks for all our builds, and for that we need to create the plugin config files ourselves (in lack of support in the REST API).
For one WebHook to be used only for one build configuration, the build-type id must be supplied in the plugin config file, hence we need the id.

For now we are creating dummy WebHooks for each build config just to get the id's. Then we generate new WebHooks through a script using these id's. Not a good solution...


-Nils Magne

0
Comment actions Permalink

Hello,

Thanks for clarification. You can get internal build configuration id using the following request:

localhost/httpAuth/app/rest/projects/<projectId>/buildTypes/id:<buildTypeExtId>/internalId

0

Please sign in to leave a comment.