Merge Check: Modify Merge Default Fields

Hi All,
I have a merge check hook, which is triggered when clicking this “Merge” button (in the final dialog before the actual merge), validating the merge.

I would like to use this hook (or another) to modify the dialog box itself.
For example, I would like to, based on the PR’s attributes and content:

  • Set a custom Commit Message
  • Allow specific merge strategies

Hook skeleton code:

public class MergePoliceCheck implements RepositoryMergeCheck
	public RepositoryHookResult preUpdate(@Nonnull PreRepositoryHookContext context, 
										  @Nonnull PullRequestMergeHookRequest request) 
          //My code

How do you suggest doing it?
Thanks in advance, TG

We don’t have anything specific like this on pr page that can customise the dialog box on certain conditions.

Try bitbucket.ui.pullrequest.overview , That one has the context for PR.

Or the one on summary page bitbucket.ui.pullrequest.overview.summary , Add the modal in there and see if that works.

To check all the extensions, you need to go to any pullrequest and set the query parameter ?clientside-extensions in the URL.

Extensions documentation

Khushbu Patel
Bitbucket Data Center