Branch
Represents a branch of the remote repository that stores sources processed by this build.
Related Help article: Feature Branches
tip
Data type:
string
Example:main
A public branch name displayed in TeamCity UI. To get a full VCS name instead (for example, 'refs/heads/main'), read the vcsBranchName property of a nested Revision entity.
tip
Data type:
string
Example:<default>
An internal branch name. Returns <default>
for default branches, and real branch names for other (non-default) branches.
tip
Data type:
boolean
Example:true
Returns true if this branch is the default branch of this build configuration; otherwise, false. When obtaining builds of the specific BuildType, add the branch(default:any) locator to get builds from all existing branches.
tip
Data type:
boolean
Example:false
Returns true for unspecified branches; otherwise, false. A branch is labeled as unspecified when TeamCity fails to find a branch for this build. Such branches have a predefined '<unspecified>' name.
tip
Data type:
boolean
Example:true
Returns true for active branches and false for inactive ones. A branch is considered inactive if it had neither new TeamCity builds in the last 24 hours, nor recent VCS repository changes in the last 7 days. Learn more: Active branches.
tip
Data type:
string
Example:20240426T123848+0200
Returns the date and time of the last branch activity (the last TeamCity build or the latest VCS commit).
tip
Data type:
boolean
Example:false
Returns true if the branch belongs to the automatically created 'My Branches' group; otherwise, false. Branch grouping allows TeamCity to automatically categorize branches based on current TeamCity user commits.
tip
Data type:
Builds
Example:
Returns all builds that target this branch.
Below, you can find a full schema of this object, in XML and JSON formats. You can choose what fields to submit depending on your current needs. Different methods might expect different fields: the best approach is to request this entity via GET
and use the response as a base for the following POST
request.
A link to another object implies that you can substitute it with the schema of the linked object, if it is required for your call.
<branch active="true" default="true" groupFlag="false" internalName="&lt;default&gt;" lastActivity="20240426T123848+0200" name="main" unspecified="false">
<builds count="12" href="/app/rest/builds?locator=buildType:Project_Config&fields=count,href" nextHref="/app/rest/builds?locator=count:200,start:250,state:finished" prevHref="/app/rest/builds?locator=count:50,start:0,state:finished">
<build>build...</build>
</builds>
</branch>
{
"internalName" : "<default>",
"default" : true,
"unspecified" : false,
"name" : "main",
"builds" : {
"build" : [ {
"agent" : "agent...",
"metadata" : "datas...",
"triggered" : "TriggeredBy...",
"usedByOtherBuilds" : true,
"settingsHash" : "settingsHash",
"number" : "54",
"chainModificationId" : "chainModificationId",
"changesCollectingInProgress" : false,
"lastChanges" : "changes...",
"resultingProperties" : "properties...",
"composite" : false,
"links" : "links...",
"id" : 8134,
"state" : "queued",
"href" : "/app/rest/builds/id:8006",
"detachedFromAgent" : false,
"compatibleCloudImages" : "cloudImages...",
"artifacts" : "files...",
"testOccurrences" : "testOccurrences...",
"artifactDependencyChanges" : "buildChanges...",
"startProperties" : "properties...",
"defaultBranch" : true,
"compatibleAgents" : "agents...",
"artifact-dependencies" : "builds...",
"replacementIds" : "items...",
"personal" : true,
"history" : true,
"tags" : "tags...",
"canceledInfo" : "comment...",
"matrixConfiguration" : "MatrixConfiguration...",
"running-info" : "progress-info...",
"versionedSettingsRevision" : "Revision...",
"percentageComplete" : 6,
"webUrl" : "https://example.com/app/rest/builds/id:8006",
"buildType" : "buildType...",
"triggeringOptions" : "buildTriggeringOptions...",
"locator" : "locator",
"startDate" : "20240408T162559+0200",
"status" : "SUCCESS",
"pinned" : true,
"customized" : true,
"approvalInfo" : "approvalInfo...",
"vcsLabels" : [ "vcsLabel..." ],
"customization" : "customizations...",
"finishEstimate" : "20240409T160130+0200",
"changes" : "changes...",
"plannedAgent" : "agent...",
"running" : true,
"statusChangeComment" : "comment...",
"finishOnAgentDate" : "20240408T162702+0200",
"buildTypeId" : "ProjectName_BuildConfName",
"buildTypeInternalId" : "buildTypeInternalId",
"originalProperties" : "properties...",
"modificationId" : "modificationId",
"related" : "related...",
"failedToStart" : true,
"revisions" : "Revisions...",
"delayedByBuild" : "build...",
"queuePosition" : 2,
"problemOccurrences" : "problemOccurrences...",
"artifactsDirectory" : "/Users/John.Doe/.BuildServer/system/artifacts/ProjectName/ConfigName/1337",
"relatedIssues" : "issuesUsages...",
"branchName" : "sandbox",
"startEstimate" : "20240409T155123+0200",
"downloadedArtifacts" : "downloadedArtifacts...",
"limitedChangesCount" : 3,
"firstBuildWithSameChanges" : "build...",
"currentSettingsHash" : "currentSettingsHash",
"unspecifiedBranch" : false,
"queuedWaitReasons" : "properties...",
"waitReason" : "There are no idle compatible agents which can run this build",
"pinInfo" : "comment...",
"snapshot-dependencies" : "builds...",
"statusText" : "Tests passed: 5, muted: 1",
"custom-artifact-dependencies" : "artifact-dependencies...",
"comment" : "comment...",
"finishDate" : "20240408T162702+0200",
"attributes" : "entries...",
"user" : "user...",
"queuedDate" : "20240408T162059+0200",
"taskId" : 9,
"properties" : "properties...",
"statistics" : "properties..."
} ],
"count" : 12,
"prevHref" : "/app/rest/builds?locator=count:50,start:0,state:finished",
"href" : "/app/rest/builds?locator=buildType:Project_Config&fields=count,href",
"nextHref" : "/app/rest/builds?locator=count:200,start:250,state:finished"
},
"active" : true,
"lastActivity" : "20240426T123848+0200",
"groupFlag" : false
}
Thanks for your feedback!