Adding comment to PR on the new code

I have been trying to add a comment on PR’s via Rest api for Bitbucket. I am able to add the comment by mentioning the line number. However, the comment is being added to the old code and not on the newly added code. Can someone help in identifying how can I target the newly added code in the PR and not the old code.