---
title: "Check mergeability of a pull request before notifying Jenkins"
canonical: "https://support.appfire.com/space/JENK/150897147/Check%20mergeability%20of%20a%20pull%20request%20before%20notifying%20Jenkins"
format: markdown
---
> Macro (aura-html)

You can run Jenkins build for a Pull Request when it is ready to be reviewed or merged. For example:

- To save build-minutes on your CI-server for work-in-progress
- To filter specific premature CI-steps like 'Deploy to staging', 'Create release' etc.

A Webhook to Jenkins option allows you to trigger build **only** when a Pull Request is mergeable. For example, when the **Merge** button is available in the Bitbucket Pull Request UI.

To enable this option:

1. Go to the repository or project settings.
2. Click the **Advanced Configuration** tab and select the** Trigger Pull request only if mergeable** option.
3. Click **Enable**.
  

> ⚠️ If you have many pull requests in your repo or project, enabling this option can cause a significant load on Bitbucket. For this reason, the feature is disabled by default.

With this option enabled, Jenkins is notified only if the pull request is mergeable.  For example, when the Pull Request:

- has no unresolved conflicts
- passes **all** configured [Merge Checks](https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html)

If these conditions are not met, the Jenkins build will not trigger.

## Using built-in Merge Checks

Bitbucket provides several useful [Merge Checks](https://confluence.atlassian.com/bitbucketserver/checks-for-merging-pull-requests-776640039.html) out-of-box, which can be used with the **Trigger Pull request only if mergeable** option to limit the number of Jenkins builds.

Below is a list of such built-in Merge Checks to use:

- **No incomplete tasks:** all tasks in Pull Request are resolved
- **All reviewers approve:** requires the reviewers to approve the Pull Request
- **No 'needs work' status:** none of the approvers has marked Pull Request as 'Needs work.'

Some Bitbucket apps, such as [YACC](https://marketplace.atlassian.com/apps/1211854/yet-another-commit-checker?hosting=datacenter&tab=overview), may provide custom Merge Checks - these checks will be respected when you enable the option.