# How to reject code check-in in Bitbucket Server Repository when SonarQube Quality Gate fails?

**URL:** <https://community.sonarsource.com/t/how-to-reject-code-check-in-in-bitbucket-server-repository-when-sonarqube-quality-gate-fails/45082>\
**Category:** SonarQube Server / Community Build\
**Created:** [June 18, 2021, 11:19am UTC](https://community.sonarsource.com/t/how-to-reject-code-check-in-in-bitbucket-server-repository-when-sonarqube-quality-gate-fails/45082 "2021-06-18T11:19:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![VivekG](https://avatars.discourse-cdn.com/v4/letter/v/cc9497/32.png) [@VivekG](https://community.sonarsource.com/u/VivekG)\
**Post date:** [June 18, 2021, 11:19am UTC](https://community.sonarsource.com/t/how-to-reject-code-check-in-in-bitbucket-server-repository-when-sonarqube-quality-gate-fails/45082/1 "2021-06-18T11:19:51Z")

</div>

Hi,

I am using Bitbucket Server (On-Premises) Repository & SonarQube (On-Premises).

I want to reject code check-in in Bitbucket Server Repository when SonarQube Quality Gate fails. (for e.g. [SonarQube - Rejecting Code Check-in when Quality Gates are not met - samirbehara](https://samirbehara.com/2017/11/22/sonarqube-rejecting-code-check-in-when-quality-gates-are-not-met/))

Please let me know the steps on how to do this task.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Monty\_Dickerson](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/monty_dickerson/32/20730_2.png) [@Monty\_Dickerson](https://community.sonarsource.com/u/Monty_Dickerson)\
**Post date:** [June 18, 2021, 9:34pm UTC](https://community.sonarsource.com/t/how-to-reject-code-check-in-in-bitbucket-server-repository-when-sonarqube-quality-gate-fails/45082/3 "2021-06-18T21:34:04Z")

</div>

Hi Vivek:

Welcome to the SonarSource community.

You can block a Pull Request when the SonarQube quality gate fails.

Here are the instructions: [Bitbucket Server Integration: Preventing pull request merges when the Quality Gate fails](https://docs.sonarqube.org/latest/analysis/bitbucket-integration/#header-4).

—  
Regards,  
Monty

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [June 28, 2021, 9:13pm UTC](https://community.sonarsource.com/t/how-to-reject-code-check-in-in-bitbucket-server-repository-when-sonarqube-quality-gate-fails/45082/5 "2021-06-28T21:13:09Z")

</div>

Closed on June 28, 2021, 9:13pm UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
