user1587504
user1587504

Reputation: 764

Comment Message retrieval From Teamcity Build

Is there a way to retrieve comment message of teamcity build during its run.

From the wiki from Teamcity noticed there are ways to reach & retrieve server build / agent build properties : http://confluence.jetbrains.com/display/TCD7/Predefined+Build+Parameters

I would like to know, if there exists a solution to retrieve comment message string from the build. If few are present under pending changes, then it has to retrieve it with some line separator.

With system properties, if we define/add new property in the build in what format it gets retrieved when we somehow parse : teamcity.build.properties.file

Thanks,

Upvotes: 3

Views: 819

Answers (1)

Boris Modylevsky
Boris Modylevsky

Reputation: 3099

In order to retrieve comments of a build you can use TeamCity REST API:

http://teamcity.codebetter.com/guestAuth/app/rest/changes?locator=build:id:216886&fields=change(id,version,href,username,date,webUrl,comment)

If you need it from C# project, you may consider using FluentTc library:

IBuild build = new RemoteTc()
   .Connect(_ => _.ToHost("teamcity.codebetter.com").AsGuest())
   .GetLastBuild(
       having => having.Id(216886),
       with => with.IncludeChanges(and => and.IncludeComment()));

Upvotes: 0

Related Questions