Recursive pull request

Hi all,

I am trying to create a pilot using Git, Fisheye, Jira and Stash (still to be decided if I will use Jenkins, Bamboo or other CI tool). The special issue about it is that I want the pull-request or code review request after it is approved by the branch maintainer to generate automatically another pull request or code review for the master branch integrator. Any ideas of how can be accomplish?

Basically I should have 3 different branches; developer’s branch, team branch to which developer’s changes are merged after first pull request gets approved and a master branch to which developer’s changes got merged after team branch maintainer pull request is approved by the integrator


Thank you in advance.


1 answer

1 accepted

Accepted Answer
0 votes
Adam Ahmed Atlassian Team Apr 02, 2013

That sounds like the perfect case for a plugin. Creating a Stash plugin has the overview of how you can do that.

Check out Responding to events and the PullRequestMergedEvent for how to determine when a pull request is merged into a certain branch. You should note that this will only fire if there actually is a pull request (if it's just merged manually then it won't work out). Depending on the exact logic you want, you might want to use a repository hook instead or in addition.

Then checkout PullRequestService.create for creating a new pull request behind the scenes whenever there is a PullRequestMergedEvent.

Good luck!

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Thursday in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

126 views 3 4
Join discussion

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