Access to chainId from kotlin dsl

Answered

Hi,

As part of my build I would like to send a notification with a link to the build chain. Looking at the TC UI I can see there is a chainId that is used to construct a URL to an individual build chain instance (like https://my-teamcity/viewChain.html?chainId=bt20539-2067039&selectedBuildTypeId=&contextProjectId=MyProjectId) Can I get access to this chainId from inside an instance of BuildType? Or is there any other way to reference the chain?

Regards

Nic

0
2 comments

Hello Nic,

Could you please let me know why a link to the build results page with Dependencies tab pre-selected would not work? Something like

<TeamCity URL>/buildConfiguration/<build configuration ID>/<build ID>?buildTab=dependencies&mode=chain

in classic UI or

<TeamCity URL>/viewLog.html?buildId=<build ID>&buildTypeId=<build configuration ID>&tab=dependencies

in experimental UI (starting from 2020.2) would yield you the Dependencies tab link for the build in question.

That being said, the chainID appears to be generated as <internal build configuration ID>-<build ID>; but the internal build configuration ID is not available in the build parameters, and would have to be requested by the REST API with an additional request; thus I would recommend the above approach. Please let me know if this helps.

0
Avatar
Permanently deleted user

Hi Fedor,

Thank very much for you reply. The experimental UI dependency tab is just what I'm after - a great suggestion. I'm new around TeamCity and I have to say there are many ways to do the same or very similar things, plus I had not even found the experimental UI :-)

Regards,

Nic

0

Please sign in to leave a comment.