In Teamcity build, how to access TimeSpentInQueue statistic during the build, inside one of the steps?
Answered
Hi Team,
I am trying to send slack notification from the teamcity build and would like to show how much time this build spent in queue.
How to access TimeSpentInQueue statistic during the build, inside one of the steps? I am unable to find a way to directly access the statistic inside the build.
TeamCity Version we are using: TeamCity Enterprise 2019.2.4
Thanks,
Ankush
Please sign in to leave a comment.
Hi Ankush,
You can try using REST API for that. You can find your running build with /app/rest/builds/{locator}. There will be such attributes as
You can calculate the difference and use it in your notification. Will that work for you?
Thanks Mikhail. This will work perfectly.