RepositoryMergeCheck example is not working


I am trying to implement pre-merge check plugin and using this example which is explained here

I am using Bitbucket v5.16.2 and

int requiredApprovals = context.getSettings().getInt(“approvals”, 0);

is always returning 0. I need to get requiredApprovers from REST address /bitbucket/rest/api/1.0/projects/PROJECTNAME/repos/REPONAME/settings/pull-requests

and trying to get the value with code behind. without calling rest. I tried couple of ways but so far “context” and settings related objects are always empty or null. in our bitbucket we use bitbucket-plugin-bundled-hooks.internal.feature.requiredapprovers. can you tell how can I get requiredApprovers ?


1 Like