add a build comment via REST API?
Answered
I can get/set tags via https://teamcity.../app/rest/builds/id:<build id>/tags/
I would like to get/set the build comment via https://teamcity.../app/rest/builds/id:<build id>/comment/ or some similar method.
Is this possible without writing my own extension to the REST API plugin?
Thanks,
Rob.
Please sign in to leave a comment.
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:
To get the build comment:
To get the Pinned build comment:
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.
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)
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).
Thank you, Denis!
You are right. It was a missed "?".