auto-merge settings issue in Stash Workzone

Hi Team

The "Attempt immediate auto-merge" is disabled in Workzone global/Admin settings, but still auto merge is happening upon merge criteria's met.

Here is my requirement

I've a Stash User group as Reviewers in Workzone settings and enabled a merge condition that groupQuota >=1. It waits for at least one group member approval to do the merge. Here I want to disable the auto merge upon merge conditions met.

How we can disable auto merge in Workzone?


3 answers

1 accepted

Hi Bijoy,

you are right - currently the auto-merge user must have repository/branch write permissions when the auto-merge configuration is saved - and yes - you can revoke those permissions later.

Another work-around is to use branch patterns - auto-merge user permissions are not enforced during configuration when you use a branch pattern in your auto-merge configuration. So instead of choosing 'master' from the dropdown, use 'refs/heads/master' in the branch pattern style configuration. This way you avoid having to revoke the temporary permissions.


Thanks Ulrich for this work-around, this is little more easy compared to add and delete dummy auto merge user.

Resolved with Workzone version 4.3.2 - leave the auto-merge user field blank.


I know it's an old post, still checking whether any possibility here.

The empty auto-merge field is working well when we set via UI. We've to set this for a group/bunch of repos via REST call and it's failing with '500 Internal Server Error' when we set auto-merge field empty in JSON object.

Wzautomerge{refName} = "refs/heads/release/1.0"
Wzautomerge{automergeUsers} = []

Am I miss anything here?

Even I tried with 'refPattern' and getting the same '500 Internal Server Error'

Wzautomerge{refPattern} = "refs/heads/release/1.0"
Wzautomerge{automergeUsers} = []

What does the json payload (string) exactly look like? 'Wzautomerge' won't be matched by the server as a data element.

Sorry it's a PERL hash, which is a key value pair, the same payload we are using for a while and it'll work fine if we pass required values for automergeUsers field.

Can you please create a Workzone support ticket and attach the relevant bitbucket log that contains the stack trace. We'll look into it.

The log and trace difficult to get it, since it's managed by a centralized services team. I'll continue to manage with dummy user addition and deletion workaround as mentioned in the beginning of the thread.

One more interesting behavior I found, even-though the return code with message coming as '500 Internal Server Error' the value/condition is adding into the Merge tab page in the Workzone.

Thanks for looking into it.

Hi Bijoy,

I understand that you don't want to trigger an auto-merge upon approval. Do I understand correctly that you want to prevent the PR to be merged if the condition is not satisfied and to be merged manually only when the merge condition is satisfied? 

Hi Ulrich

Thanks for the prompt and quick response.

Yes, that's what we want. Once conditions are met, we need to manually merge changes. We already disabled "Attempt immediate auto-merge", but still it's merging the changes once the condition is satisfied.

Are we missing any property settings? Or do we need to restart the Stash service to take this change?

As a workaround, currently we are adding a dummy auto-merge user with WRITE enabled at project/repo level for configuring the workzone and remove that user rights once workzone settings enabled, so that auto-merge won't happen upon conditions met.

Thanks in advance




Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

657 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you