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

Error merge API 2.0

gcordobap
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 28, 2023
I get this error when I want to merge via API 2.0
{"type": "error", "error": {"message": "newstatus: Merging a pull request requires write access to the destination branch.", "fields": {"newstatus": ["Merging a pull request requires write access to the destination branch."]}}}
 

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 2, 2023

Hello @gcordobap ,

Welcome to Atlassian Community!

Based on the error message you are receiving, the user you are using to authenticate the API call does not have write access to the destination branch (or the destination repository in case of a fork) of the pull request

This could happen if :

  • The user has only read permissions to the repository. In this case, you would need to reach out to an Admin to update your access to write
  • There's a branch restriction in the repository that limits the users that can write/merge to a given branch/branch pattern in pull requests. In this case, you would need to contact one of the repository or workspace admins to change that branch permission and add you to the users allowed to merge into the destination branch.

I would suggest checking the two scenarios above to confirm if any of those access settings are preventing your user to merge the pull request.

Hope that helps!

Thank you, @gcordobap 

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events