(REST API) Get Full Branch Specifications For VCS Root?
Hello,
Is there an endpoint that exposes the full branch specifications for a VCS root? (See below for example)
I am attempting to get pending changes through the API for a particular build config, by using %teamcity.build.branch% in the locator. (Ex: /app/rest/changes?locator=buildType:(id:build_type_ID),pending:true,branch:refs%2Fheads%2Frelease-5.5).
However, this parameter uses the logical branch name, meaning I either have to enforce that all my build configurations do not use logical names, or figure out a way to determine the full branch specification based on the logical branch name. I do not want to make all of my VCS roots be without logical branch names, but I cannot determine any means of retrieving branch specifications to compare the logical branch name against.
Is there a resource which I can use to retrieve this information?
Please sign in to leave a comment.
Hi there,
you can get the branch spec with:
/app/rest/vcs-roots/id:<vcs root id>
It's in the "properties" list, a property named "teamcity:branchSpec"
More information here:
https://confluence.jetbrains.com/display/TCD10/REST+API#RESTAPI-VCSRoots
Thank you, this is what I am looking for!