In my PR, a file MyFile.java is updated. Old line number is 123 and new line number after change is 234. I am trying to add a comment on new line 234 via REST API. I have tried several combinations of request body but its adding comment on old line number 123. Can someone please help with this behavior?
curl --location --request POST 'https://{{bitbucket-host}}/rest/api/latest/users/testuser/repos/my-service/pull-requests/2/comments' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer ABCD-123' \
--data-raw '{
"text": "Field can be converted to a local variable - AT1",
"severity": "BLOCKER",
"anchor": {
"line": 234,
"lineType": "CONTEXT",
"fileType": "TO",
"path": "src/func-test/java/com/test/MyFile.java"
}
}'