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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Bitbucket Pipeline - Error creating a Pull Request - "Branch not found"


I'm trying to create a scheduled pipeline which will retrieve from a Salesforce instance and create a Pull request with any changes that have been retrieved. Broadly speaking it:

  1. Checkouts "develop"
  2. Creates a new branch locally
  3. Retrieves from Salesforce
  4. Commits the changes
  5. Pushes the new branch to Bitbucket
  6. Calls the API to create a Pull Request for somebody to review and merge to "develop"

The issue is with step 6. The call to the API results in an error:

"source: branch not found: {{branch name is in here}}"

The bitbucket bash script has the following commands directly following each other:

  • git push
  • node {{reference to JS file which makes the API call}}

The branch name matches with the one just pushed. Is there an issue with timing (e.g. do we need to pause before making the API call), or is something else at play here?


  • I've update my node script to include a delay, but that hasn't appeared to have worked
  • I've used Postman API with the same bearer token and, as far as I can tell, the same API call and that is able to create the Pull Request as expected.


1 answer

1 accepted

0 votes
Answer accepted

Apologies - This was related to a typo in the arguments passed between the bash script and the node javascript.

It is completely possible to git push in the bash script and immediately call the pull requests API in the node script and create a Pull Request

Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events