How to Iterate Through the Last Successful Builds in Pipeline Job? Bee Bot July 13, 2022 11:20 Updated The content of this article has moved to the new documentation site. Related articles Groovy to list all jobs How can I check previous build status in a Pipeline Script? How to access Changelogs in a Pipeline Job? Pipeline - Build failed due to MissingPropertyException: No such property: env How to Customize Checkout for Pipeline Multibranch? Comments 2 comments Sort by Date Votes Vaclave Vaclave October 10, 2017 21:10 It may be useful to do: build.result.toString().equals("SUCCESS") rather then: build.result != 'FAILURE' because the build.result field is a hudson.model.Result so it won't ever be equal to a String. 2 Richard Scott January 30, 2020 00:20 Edited changing the double quotes on build.result.toString().equals("SUCCESS") To build.result.toString().equals('SUCCESS') filtered the SUCCESS string on my pipe line jobs 0 Please sign in to leave a comment.
Comments
2 comments
It may be useful to do:
rather then:
because the build.result field is a hudson.model.Result so it won't ever be equal to a String.
changing the double quotes on build.result.toString().equals("SUCCESS")
To
build.result.toString().equals('SUCCESS')
filtered the SUCCESS string on my pipe line jobs
Please sign in to leave a comment.