Where can I find a list of valid values for currentBuild.result? I thought it was just a string, but it appears to only allow certain values.
For example, this code: echo "currentBuild.result1: '${currentBuild.result}'" currentBuild.result = 'FAILEDZZZZ' echo "currentBuild.result1: '${currentBuild.result}'"
I am new to jenkins and groovy and I'm trying to print out using this same example other values such as
currentBuild.durationString and others, I have followed this example and the one from https://plugins.jenkins.io/logstash/, trying to print out the currentBuild.durationString like result in data, it that possible to do, any suggestions of how can I accomplish it?, Any help is really appreciated.
Comments
5 comments
Where can I find a list of valid values for currentBuild.result? I thought it was just a string, but it appears to only allow certain values.
For example, this code:
echo "currentBuild.result1: '${currentBuild.result}'"
currentBuild.result = 'FAILEDZZZZ'
echo "currentBuild.result1: '${currentBuild.result}'"
Will yield this:
Hi Kenneth,
You are right. currentBuild.result is not a simple String. It is a String representation of hudson.model.Result.
The reason why you see FAILURE when the String does not match a known value is because of this method.
Regards,
Just what I was looking for. Thank you very much!
Just for making it easy there are two other interesting statuses ABORTED and UNSTABLE
Hello everyone :) !!
I am new to jenkins and groovy and I'm trying to print out using this same example other values such as
Please sign in to leave a comment.