@DataBoundSetter
public void setRequiredResult(final Result requiredResult) {
this.requiredResult = requiredResult;
}
When this parameter is set in the snipped generator, then the snipped generator creates the parameter as
discoverReferenceBuild requiredResult: 'FAILURE‘
This works for scripted pipelines, but not for declarative pipelines. In declarative pipelines I get an error:
WorkflowScript: 43: Expecting "class hudson.model.Result" for parameter "requiredResult" but got "SUCCESS" of type class java.lang.String instead @ line 43, column 67.
Is there a way to provide a hint for declarative pipelines so that the conversion of String to Result is handled automatically?
As a workaround I am now adding a String parameter as well, but this seems to be not elegant.
PR: https://github.com/jenkinsci/forensics-api-plugin/pull/614
Issue: https://issues.jenkins.io/browse/JENKINS-75846