Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to get the destiny branch of a PR using Atlassian SDK in Bitbucket Server Plugin?

StormSucker April 3, 2020

I managed to implement "isAdminMergeCheck" following a tutorial: https://developer.atlassian.com/server/bitbucket/tutorials-and-examples/controlling-when-pull-requests-can-be-merged/

 

But for my check, I need to call this plugin only for certain branches (only for "master" and "develop"). Yet, using the Atlassian API, i can't get it. I tried using "getPullRequest().getToRef()" but I don't think it contains information about destiny branch. Or maybe I can't use it?

 

How to check destination branch in MergeCheck? Or how to call mergeCheck only for certain branches?

1 answer

0 votes
Yingran Sun
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 23, 2020

You can get the name of the destination branch of the pull request by using `request.getToRef().getId()` where `request` is your `PullRequestMergeHookRequest`.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events