File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/main/java/com/cloudbees/jenkins/plugins/bitbucket Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1206,7 +1206,14 @@ public ListBoxModel doFillRepositoryItems(@AncestorInPath SCMSourceOwner context
12061206 if (context != null && !context .hasPermission (CredentialsProvider .USE_ITEM )) {
12071207 return new ListBoxModel (); // not permitted to try connecting with these credentials
12081208 }
1209- serverUrl = StringUtils .defaultIfBlank (serverUrl , BitbucketCloudEndpoint .SERVER_URL );
1209+
1210+ String serverUrlFallback = BitbucketCloudEndpoint .SERVER_URL ;
1211+ // if at least one bitbucket server is configured use it instead of bitbucket cloud
1212+ if (BitbucketEndpointConfiguration .get ().getEndpointItems ().size () > 0 ){
1213+ serverUrlFallback = BitbucketEndpointConfiguration .get ().getEndpointItems ().get (0 ).value ;
1214+ }
1215+
1216+ serverUrl = StringUtils .defaultIfBlank (serverUrl , serverUrlFallback );
12101217 ListBoxModel result = new ListBoxModel ();
12111218 StandardCredentials credentials = BitbucketCredentials .lookupCredentials (
12121219 serverUrl ,
You can’t perform that action at this time.
0 commit comments