As mention in bibucket server REST api documentation link. I am trying to fetch the comments.
(/rest/api/1.0/projects/OTP/repos/otplanner/pull-requests/20/comments?ANCHORSTATE="ALL"&DIFFTYPE="EFFECTIVE")
It gives me below error
{
"errors": [
{
"context": null,
"message": "The path query parameter is required when retrieving comments.",
"exceptionName": null
}
]
}
Suggest on this
Hi Suresh,
The message in the response suggests that you are missing the path. Please note the "comments" endpoint can't be used without the path variable. For example following
PROJECT_1/repos/rep_1/pull-requests/1/comments?path=add_file/add_file.txt can be used to retrieve the comments for the file add_file.txt in add_file folder.
If you are looking for general pull request comments then I would suggest using activities.
Hope this helps.
Best regards,
Prasanth Thaikkalloor
Thanks Prasanth.
Can we set the author of the comment while creating comment from REST API for cloud.
I tried it but, it alwas set API call executer user.
{
"parent": {
"id": 75136852
},
"content": {
"raw": "Test reply comments from api"
},
"user": {
"username": "xxx",
"display_name": "xxx 007"
},
"inline": {
"path": "test"
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.