I have a Microsoft Teams webhook which will alert me when a TeamCity build has failed. I am wondering how I would be able to get the URL of the current TeamCity build so I can pass this information to my webhook.
Asked
Active
Viewed 1,417 times
1 Answers
6
Only using parameters at hand, you could build the uri back to the build log:
%teamcity.serverUrl%/viewLog.html?buildId=%teamcity.build.id%
If you're using a MessageCard, this would make the potentialAction
field of the payload to something like:
"potentialAction": [
{
"@type": "OpenUri",
"name": "View in TeamCity",
"targets": [
{
"os": "default",
"uri": "%teamcity.serverUrl%/viewLog.html?buildId=%teamcity.build.id%"
}
]
}
]
Anything fancier would require a call to the TeamCity REST API

Fluffy
- 857
- 1
- 9
- 20