getLinks() {
diff --git a/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/server/client/pullrequest/BitbucketServerPullRequestCanMerge.java b/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/server/client/pullrequest/BitbucketServerPullRequestCanMerge.java
new file mode 100644
index 000000000..4ebb8b5a8
--- /dev/null
+++ b/src/main/java/com/cloudbees/jenkins/plugins/bitbucket/server/client/pullrequest/BitbucketServerPullRequestCanMerge.java
@@ -0,0 +1,17 @@
+package com.cloudbees.jenkins.plugins.bitbucket.server.client.pullrequest;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class BitbucketServerPullRequestCanMerge {
+ private boolean canMerge;
+
+ public boolean isCanMerge() {
+ return canMerge;
+ }
+
+ @JsonProperty
+ public void setCanMerge(boolean canMerge) {
+ this.canMerge = canMerge;
+ }
+
+}
diff --git a/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketCloudEndpoint/config-detail.jelly b/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketCloudEndpoint/config-detail.jelly
index 72bab88ef..e78b6c230 100644
--- a/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketCloudEndpoint/config-detail.jelly
+++ b/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketCloudEndpoint/config-detail.jelly
@@ -1,6 +1,15 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketServerEndpoint/config-detail.jelly b/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketServerEndpoint/config-detail.jelly
index 3460604c6..d2f2f7f7b 100644
--- a/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketServerEndpoint/config-detail.jelly
+++ b/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketServerEndpoint/config-detail.jelly
@@ -7,4 +7,7 @@
+
+
+
diff --git a/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketServerEndpoint/help-callCanMerge.html b/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketServerEndpoint/help-callCanMerge.html
new file mode 100644
index 000000000..3c2c5bd56
--- /dev/null
+++ b/src/main/resources/com/cloudbees/jenkins/plugins/bitbucket/endpoints/BitbucketServerEndpoint/help-callCanMerge.html
@@ -0,0 +1,3 @@
+
+ Always call the can merge api on pull requests to ensure the source code references are up to date.
+
diff --git a/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/UriResolverTest.java b/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/UriResolverTest.java
index 82f13f064..e835e3392 100644
--- a/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/UriResolverTest.java
+++ b/src/test/java/com/cloudbees/jenkins/plugins/bitbucket/UriResolverTest.java
@@ -35,7 +35,7 @@ public class UriResolverTest {
@Test
public void httpUriResolver() throws Exception {
- BitbucketApi api = new BitbucketCloudApiClient("test", null, null);
+ BitbucketApi api = new BitbucketCloudApiClient(false, 0, 0, "test", null, null);
assertEquals("https://bitbucket.org/user1/repo1.git", api.getRepositoryUri(
BitbucketRepositoryType.GIT,
BitbucketRepositoryProtocol.HTTP,
@@ -70,7 +70,7 @@ public void httpUriResolver() throws Exception {
@Test
public void sshUriResolver() throws Exception {
- BitbucketApi api = new BitbucketCloudApiClient("test", null, null);
+ BitbucketApi api = new BitbucketCloudApiClient(false, 0, 0, "test", null, null);
assertEquals("git@bitbucket.org:user1/repo1.git", api.getRepositoryUri(
BitbucketRepositoryType.GIT,
BitbucketRepositoryProtocol.SSH,