Teamcity API, build configuration status in the project

I am trying to find if there is any API method or call with which I can get the status of the last assembly configuration, for example, the last assembly is still running, has been queued successfully.

I managed to get only the last successful assembly details, but not the assembly status.

http://<TeamcityServer>/httpAuth/app/rest/builds/buildType:(id:BUILDTYPE),status:SUCCESS
+4
source share
1 answer

To find out if the queue in the queue, started or completed set, you need to get the value state, not status.

http://<TeamcityServer>/httpAuth/app/rest/builds/?locator=buildType:<BuildType>,state:any,branch:default:any,count:15

buildType: name specified in your configuration with the project prefix.

state: Possibles values: wait, queue, work.

branch: , . default.

count: .

:

<builds count="5" href="/guestAuth/app/rest/builds/?locator=buildType:A_B,state:any,branch:default:any,count:5" nextHref="/guestAuth/app/rest/builds/?locator=buildType:A_B,state:any,branch:(default:any),count:5,start:5">
    <build id="3767209" buildTypeId="A_B" state="queued" branchName="refs/heads/master" defaultBranch="true" href="/guestAuth/app/rest/buildQueue/id:3767209" webUrl="http://<TeamCityServer>/viewQueued.html?itemId=3767209"/>
    <build id="3767307" buildTypeId="A_B" state="queued" branchName="5566" href="/guestAuth/app/rest/buildQueue/id:3767307" webUrl="http://<TeamCityServer>/viewQueued.html?itemId=3767307"/>
    <build id="3767394" buildTypeId="A_B" state="queued" branchName="5558" href="/guestAuth/app/rest/buildQueue/id:3767394" webUrl="http://<TeamCityServer>/viewQueued.html?itemId=3767394"/>
    <build id="3767425" buildTypeId="A_B" state="queued" branchName="5563" href="/guestAuth/app/rest/buildQueue/id:3767425" webUrl="http://<TeamCityServer>/viewQueued.html?itemId=3767425"/>
    <build id="3766826" buildTypeId="A_B" number="7398" status="SUCCESS" state="running" running="true" percentageComplete="42" branchName="5570" href="/guestAuth/app/rest/builds/id:3766826" webUrl="http://<TeamCityServer>/viewLog.html?buildId=3766826&buildTypeId=A_B"/>
</builds>
+3

Source: https://habr.com/ru/post/1680123/


All Articles