I've been trying to configure and Bitbucket Server endpoint using groovy 
script from the script console.
I've been following the example given 
here: https://plugins.jenkins.io/cloudbees-bitbucket-branch-source but 
using a BitbucketServerEndpoint instead of bitbucketCloudEndpoint. My code 
is:


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

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/c34251c7-4fdd-40fc-9f33-74709230e95f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to