mutiple pull requests with command prompt and not with stash server

anil kumar May 18, 2014

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

0 votes
anil kumar June 1, 2014
Hi atlasians, Can you give any suggestion on this regard.. Anil
0 votes
anil kumar June 1, 2014

Any clue for this ...

0 votes
anil kumar May 29, 2014

Any suggestion regarding this..

0 votes
anil kumar May 28, 2014

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

0 votes
anil kumar May 28, 2014

Any information for this..!

0 votes
anil kumar May 25, 2014

any inputs please..

0 votes
anil kumar May 18, 2014

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

0 votes
anil kumar May 18, 2014

Any suggestions...

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events