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

Branch Name from Pull Request or MergeRequest in Plugin

David Gersh May 1, 2015

I've done a lot of research and haven't had any luck chasing down how to do this.

I am writing a stash plugin and want to know if its possible to get the "to branch" name programmatically?

I would have assumed it would be available somewhere in MergeRequest "request" or request.getPullRequest().

Any help or guidance would be appreciated I've been chasing this off and on for weeks.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Balázs Szakmáry
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 3, 2015

I think you are looking for PullRequest.getFromRef() and PullRequest.getToRef() .

0 votes
David Gersh May 5, 2015

An example for people:

if (!context.getMergeRequest().getPullRequest().getToRef().getId().equalsIgnoreCase("refs/heads/develop"))
TAGS
AUG Leaders

Atlassian Community Events