I've been trying to configure and Bitbucket Server endpoint using groovy script from the script console.
import jenkins.model.Jenkins
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.*
def endPoint = new BitbucketServerEndpoint(
"Bitbucket Server",
"{{ bitbucket_url }}",
true, // manageHooks
"bitbucket_password_credential"
)
Jenkins jenkins = Jenkins.getInstance()
def bitbucketEndpointConfiguration = jenkins.getDescriptor("com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration")
bitbucketEndpointConfiguration.updateEndpoint(BitbucketServerEndpoint)
jenkins.save()
I'm getting the following error that I don't understand:
groovy.lang.MissingMethodException: No signature of method: com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration.updateEndpoint() is applicable for argument types: (java.lang.Class) values: [class com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketServerEndpoint] Possible solutions: updateEndpoint(com.cloudbees.jenkins.plugins.bitbucket.endpoints.AbstractBitbucketEndpoint)
Can anyone suggest what I'm doing wrong, and the correct way to do this?
Thanks,
Nick