There's a (very) new plugin that seems to do exactly what you want:

https://github.com/Spedge/job-run-uuid
https://github.com/jenkinsci/job-run-uuid-plugin

Its developer wrote on the Jenkins devs list:

> The plugin allows you to request a build from the API but it returns a JSON 
> snippet with a UUID for the job. This allows you to track the status of a job 
> (using another part of the API) even before it has left the queue and has 
> been assigned a run id - being in the queue is a valid state.
> 
> I've found it very useful for executing batches (100+) of the same job but 
> with different parameters, then tracking the status of them as they get 
> completed.
> 
> [...]
> 
> I'm also happy to listen to any suggestions or recommendations for this :)

Regards
Daniel

On 22.11.2013, at 11:56, Julian Payne <[email protected]> wrote:

> I am trying to use the REST API to submit a job and follow it's progress. The 
> problem that I am facing is that I can not see a fool-proof way to know what 
> is the job number of the new job when I submit using 
> job/MyJob/buildWithParameters
> 
> What I get back as JSON is designed for the UI but does not seem to give me 
> an explicit handle to the new job.
> 
> Here are the different replies that I seem to get:
> 
> 1. inQueue = true
>     queueItem = null
>     nextBuildNumber = <n>
> 
>     In this case I could suppose that my build will be <n> but as I need 
> concurrent builds is this guaranteed?
> 
> 2. inQueue = true
>     queueItem = { number = <n> ... }
> 
>     Again I can see that there is a build in the queue but how can I be sure 
> that is mine?
> 
> It seems that the REST API works fine for the Jenkins UI that does not track 
> specific jobs but not really designed to submit and track a specific job?
> 
> Hopefully I missed something and this is not the case?
> 
> Thanks in advance
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to