Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

I Am Encountring 500 Internal Server Error When Adding Comment to Pull Request Threw The Api.

BrahimDev
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!
September 16, 2024

 

Hello Everyone , I am encountering a 500 Internal Server Error while trying to add a comment to a pull request using the Bitbucket API. I have been using the following endpoint and request format:

Endpoint: POST https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pullRequestId}/comments

Request Body:

{ "content": { "raw": "Test comment from bot" } }

Details:

  • Workspace: {workspace}
  • Repository Slug: {repo_slug}
  • Pull Request ID: {pullRequestId}
  • Error ID from Response: f9f2948716a144c3927b477d12992011

Issue: I receive the following error response:

{ "type": "error",

"error": { "message": "Something went wrong",

"id": "f9f2948716a144c3927b477d12992011"

} }

 

 

I have verified that:

  • The request URL and payload format are correct.
  • The payload meets the API’s specifications.
  • I am not exceeding any API rate limits.

Could you please help me understand what might be causing this error and how I can resolve it?

THANK YOU.

1 answer

1 vote
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 17, 2024

Hello @BrahimDev ,

and welcome to the Community!

Since the repository you're testing with seems to be a public repository, I suspect this error has to do with the authentication not being provided. 

Could you confirm if you are authenticating the request? If not, could you try authenticating using basic auth (username and app password) or a repo access token and let us know if the error persists?

Even though the repository is public, the API call to add a comment needs to come from an authenticated user/token bot.

Thank you, @BrahimDev !

Patrik S

BrahimDev
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!
September 17, 2024

Thank you

 

Like Patrik S likes this
Anthony Nguyen
Contributor
October 31, 2024

@Patrik S I'm having a similar issue, but with update pull request where I am just trying to change the title. I am using basic auth, and it works for get pull request. When creating the app password, I checked the options for pull request.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 31, 2024

Hello @Anthony Nguyen ,

I would like to ask if you could please create a new question for your issue, providing details on the errors you see.

We generally encourage users to create a new question for their issue instead of posting on someone else’s question, because:

1) the root cause and resolution may be different for each case

2) a question can become cluttered and difficult to follow if we try to troubleshoot multiple users’ issues in it.

Please feel free to let me know if you have any questions.

Thank you, @Anthony Nguyen !

Patrik S

Anthony Nguyen
Contributor
October 31, 2024

I have but no one has responded so I am trying to find similar problems or someone who can provide some answers.

Suggest an answer

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

Atlassian Community Events