-
Notifications
You must be signed in to change notification settings - Fork 28
KotlinDSL Format
netwolfuk edited this page Jul 15, 2025
·
4 revisions
Since tcWebHooks-3.0.0-alpha.1
Since 3.0.0, WebHooks are defined in TeamCity as ProjectFeatures. We define project features in TeamCity's Kotlin DSL inside our project's settings.kts
file. Within this file we need to place them in the features
block, which is in turn located within the project
block.
// TeamCity Project definition
project {
// Features are defined within a project
features {
// webhooks are defined as features.
webHookConfiguration {
// webhook definition
}
webHookConfiguration {
// a second webhook definition
}
}
}
The minimum attributes required are webHookId
template
, url
, buildTypes
, and buildStates
.
webHookConfiguration {
/*
* webHookId must be unique across all of teamcity.
* A simple way to guarantee this is to base the name on the current project, and use a number
*/
webHookId = "RootProjectId_WebHook_01"
/*
* template refers to the ID of a template.
* The Template ID is at the top of the template page for viewing a template.
*/
template = "legacy-json"
/*
* url is the web address of where to deliver the webhook POST request.
*/
url = "http://localhost:8111/webhooks/endpoint.html?vcs_test=1"
/*
* builsTypes define which builds will trigger this webhook
*
*/
buildTypes = allProjectBuilds {
subProjectBuilds = true
}
buildStates {
buildAddedToQueue = true
buildRemovedFromQueue = true
}
}
- Home
- Installing
- Configuration
- Templates
- Parameters (aka Variables)
- Example Webhook output
- WebHooks REST API