Details
-
New Feature
-
Status: Resolved (View Workflow)
-
Major
-
Resolution: Won't Fix
Description
I second this. It would be really nice to see the actual build number created in the response somewhere when using the api build and buildWithParameters calls. We can try to figure it out based on the nextBuildNumber, plus parsing through the queue/api/xml output, but it is not guaranteed.
Attachments
Issue Links
- is duplicated by
-
JENKINS-4538 Returning build number when performing a remoteAPI build action
-
- Resolved
-
-
JENKINS-5189 When you trigger a task there is no page for it until the task starts to build
-
- Resolved
-
-
JENKINS-16263 Return the number of the build that was triggered using REST API.
-
- Resolved
-
-
JENKINS-50361 Return buildId when a job been triggered.
-
- Closed
-
- is related to
-
JENKINS-16827 console display wrong build number when triggering a new build
-
- Resolved
-
-
JENKINS-29222 Plugin detects the wrong build as triggered occasionally
-
- Open
-
-
JENKINS-26228 Allow for minimum time to live on item in queue, to ensure api consumers can connect a queue id to a job id
-
- Open
-
Build numbers don't get assigned to queued builds, and for good reason: Between QueueSorter, QueueTaskDispatcher, and plugins like Set Next Build Number, this is impossible to determine before actually starting the build. Then there's the issue of canceling queue items – they don't (and shouldn't) use up build numbers, which this change would necessitate (or result in wrong results, as a specific build number could be queued and canceled again multiple times).
However, there's an easy API solution that considers that issue when triggering builds.
Trigger the build and check the headers:
Get the Location value, and check its API at e.g. /queue/item/25/api/xml (formatted for readability):
This contains all the information you could possibly want here. And once the build starts and a build number has finally been assigned, you get the build number and build URL:
As this feature is at least next to impossible to implement in a backwards compatible way, and has an easy, complete solution already, I'm resolving this as Won't Fix.