Reputation: 8531
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.
Upvotes: 3
Views: 2109
Reputation: 922
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
Upvotes: 7