Question
The requirement is to check whether the previous build failed using REST API. How can this be achieved?
Answer
- Get the current build's information by its ID:
GET /app/rest/builds/4114 - Get the current build's
buildTypeIdandnumberfrom the response:<build id="4114"buildTypeId="TcPythonTest_Dependent" number="9"status="SUCCESS" state="finished" branchName="main" defaultBranch="true" href="/app/rest/builds/id:4114" webUrl="..."> - Use it to get the status of the previous build:
GET /app/rest/builds/buildType:TcPythonTest_Dependent,number:8/status
Comments
0 comments
Please sign in to leave a comment.