Is it possible to retrieve the ID of Jenkins built through its API?

Suppose I trigger the build by sending a GET request to /job/awesomesauce/build. Is it possible to retrieve the ID that triggered the build?

I know that I can try to access /job/awesomesauce/lastBuild/api/json, but if there are multiple builds running at the same time, this will give me wrong information. Also, in providing me There seems to be a slight delay (a few seconds) before information about the currently running build.

I have to do this kind of thing, this is a workaround I use: I have a dummy parameter that I pass to the build (in my case, it is the BUILD_ID of another build; in your case, it It may be a timestamp), I then query and parse the build queue api ([server]/queue/api/…) and the regular api (if the build has been completed), the build containing the appropriate parameter values.

Suppose I trigger the build by sending a GET request to /job/awesomesauce/build. Is it possible to retrieve the ID that triggered the build?

I know that I can try to access /job/awesomesauce/lastBuild/api/json, but if there are multiple builds running at the same time, this will give me wrong information. Also, in providing me There seems to be a slight delay (a few seconds) before the information about the currently running build.

I have to do this kind of thing, this is what I use A workaround: I have a dummy parameter that I pass to the build (in my case, it is the BUILD_ID of another build; in your case, it may be a timestamp), I then query and parse Build queue api ([server] / queue / api / …) and regular api (if the build is completed), including the construction of appropriate parameter values.

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 2753 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.