mutiple pull requests with command prompt and not with stash server

Hi All,

Used REST APIS to create mutiple pullrequests. i.e.,

from localBranch to MASTER1 , MASTER2

localBranch------->MASTER1,MASTER2

I have two local commits , for each commit included a valid ticket number and I want to merge with to MASTER! and MASTER2 at same time.

My usecase is:

Whenever any pull request happens I need to show the pull-request creation(initiation) status to my ticket portals based on commit messag's ticket number.

My Approach :

So for this I used post-hook and created EventListeners i.e., pull-request open Event. It is working fine.

Problem I'm facing:

In localBranch I'm having lets say two commmits (comm1, comm2).

So after pull-request with command prompt, the pull-request created successfully and

It should get (used random shaid_ids for each commit in below example)

comm1 with sha-id ....7ef target is MASTER1

comm1 with sha-id ....7ef target is MASTER2

comm2 with sha-id ....a1e target is MASTER1

comm2 with sha-id ....a1e target is MASTER2

But I'm getting,

comm1 with sha-id ....7ef target is MASTER1

comm1 with sha-id ....7ef target is MASTER2

comm2 with sha-id ....a1e target is MASTER2

comm2 with sha-id ....a1e target is MASTER2

So it looked like target branch is repeating.
I suspect i have to do much more with my post-hook's Event Listeners (pullRequestOpenedEvent).
And I noticed If I give the pull request manually i.e, via after login into stash server and if click on pull-request button for localBranch to MASTER1 thereaftet localBranch to MASTER2 then there is no problem for me.
But with REST API if i give the pull-request with one local branch to multiple branches then how can I achieve it via my hook.
I'm sure that My listener is calling based on target number of branches (means those many times listener is calling).
I thought I have to do with threads with synchronized. If first request comes until completition of this the second one should wait, But looking for this type of approach If any one had it earlier.
Thanks In advance
Anil

8 answers

Any suggestions...

EventListeners that is pullRequestOpened() or onPullRequestOpened(), how to handle mutiple pull requests with REST API.

any inputs please..

Any information for this..!

am i not clear here...Any ssuggestion please..

Any suggestion regarding this..

Any clue for this ...

Hi atlasians, Can you give any suggestion on this regard.. Anil

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

1,929 views 1 5
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