-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get current build number? #70
Comments
Actually, there is no way to get the CURRENT build number. Instead we could get the last build number. |
Do you mean that after I create a job using BuildJobWithParams, I then use GetJob to get the last id of Builds[]Build as the build number of the current jobid? |
It's true if there is only one build request in the short time. By the way, Jenkins will create a queue job, then there is a worker will consume that queue item. So, we cannot get the build ID after the build request. Because it might does not have the ID yet in sometime. |
Thank you, is there any way I can customize the job number?
I found that |
As far as I know, the job build number can only be generated by Jenkins itself. |
If it cannot be customized, then I can only add a unique identifier to distinguish it. |
This is a good idea I believe. |
hello, @LinuxSuRen
2023/10/10 11:16:06 &{SimpleJobBuild:{Number:2931 URL:https://example.com/job/php-migrate-script/2931/} Building:true Description: DisplayName:#2931 Duration:0 EstimatedDuration:42531 FullDisplayName:php-migrate-script #2931 ID:2931 KeepLog:false QueueID:5057 Result: Timestamp:1696907748017 PreviousBuild:{Number:2930 URL:https://exmaple.com:443/job/php-migrate-script/2930/} NextBuild:{Number:0 URL:}} problem: |
It might be a bug if you only triggered the job build once. |
Yes, I checked to make sure it was only executed once |
Please feel free to fix this if you're interested in it. |
No description provided.
The text was updated successfully, but these errors were encountered: