5 comments
Avatar
Permanently deleted user

Hello Rob,

 

Please clarify which of build comments you would like to set/get - a comment from Actions | Comment or a Pinned comment (Actions | Pin)?

E.g.

To set the build comment:

curl -X PUT "https://teamcity.../app/rest/builds/id:<build id>/comment" --header "Content-Type: text/plain" -d "<Your_Comment_Here>"

To get the build comment:

curl -X GET "https://teamcity.../app/rest/builds/id:<build id>?fields=comment(user(name),text,timestamp)"

To get the Pinned build comment:

curl -X GET "https://teamcity.../app/rest/builds/id:<build id>?fields=pinInfo(text)"

 

0
Avatar
Permanently deleted user

Very good!

 

Thank you for this response. Somehow in my reading of the docs I missed that this was possible and now it is working perfectly.

 

Cheers!

 

Rob.

0
Avatar
Permanently deleted user

It seems that the getting of a build comment doesn't work. When I execute the second command (to get the comment) I get:

Responding with error, status code: 404 (Not Found).
Details: jetbrains.buildServer.server.rest.errors.NotFoundException: Field 'fields=comment(user(name),text,timestamp)' is not supported. Supported are: number, status, id, startDate, finishDate, buildTypeId, branchName.

 

Our version of TC: TeamCity Enterprise 2018.1 (build 58245)

0

Hi,

 

From the error message it seems that you are not adding the "?" to the URL before "fields" (if you are already passing the locator as a URL parameter, then add & instead). 

1
Avatar
Permanently deleted user

Thank you, Denis!

You are right. It was a missed "?".

 

0

Please sign in to leave a comment.