Bitbucket code suggestions: how they are applied, and what goes wrong
In a comment on lines of a pull request, a reviewer can write the code those lines should become, and the author applies it with a button, as a new commit on the source branch. Bitbucket Cloud has had code suggestions since July 21, 2025 (BCLOUD-17360, 313 votes). Bitbucket Data Center has had them since Bitbucket Server 6.6, on one line at a time until 9.3.0 brought suggestions on several lines (BSERV-12219, 461 votes).
Suggesting and applying
- Bitbucket Cloud (Atlassian's documentation): select + next to a line of the diff, or drag from it to the last line for several; then the Suggest code button of the editor's toolbar, or type
/suggestcode, and write the new code. The pull request's author, or a member with write permission on the repository, selects Apply suggestion and then Commit changes; the pull request refreshes with the change in the diff. - Bitbucket Data Center (Atlassian's documentation): the suggestion button of the comment box puts a code block in the comment for the new code. Someone with write access to the source repository selects Apply suggestion, can edit the commit message, and selects Commit changes, which adds a new commit to the pull request.
- Each suggestion is applied as its own commit; grouping several into one commit is an open request (BSERV-12163, 14 votes).
- In the comment's text, a suggestion is a fenced block that starts with
```suggestion. Through the Cloud REST API it is a comment whosecontent.rawholds that block and whoseinlinehasstart_toandtofor the lines (as in BCLOUD-24074 below).
Known problems
From Atlassian's public issue tracker, as of October 26, 2026:
- Tabs become spaces (Cloud). When the suggested code is indented with tabs, applying it writes four spaces instead, a whitespace change nobody suggested (BCLOUD-24074, reported April 2026, 10 votes, open). Look at the commit's whitespace before merging.
- Other characters of the file change (Cloud). Sometimes, when the file has Unicode characters elsewhere, applying a suggestion also changes them; the workaround is to put those characters back (BCLOUD-23990, January 2026, open).
- Backticks inside a suggestion (Cloud). If the suggested text contains a fenced block of its own (three backticks), it closes the suggestion early and the rest shows as ordinary comment text (BCLOUD-24193, July 2026, open).
- CRLF becomes LF (Data Center). Applying a suggestion removes the carriage returns of a file with Windows line endings (BSERV-13105, seen on 6.7.0 and 7.19.2, long-term backlog).
- A hook refuses the commit (Data Center). A pre-receive hook or an app such as Yet Another Commit Checker can refuse the commit that applying makes; before 7.14.0 that gave a generic error and the button could not be used again (BSERV-12528, fixed in 7.14.0).
- The suggestion lands on the wrong line (Data Center). A suggestion written on a page that was not refreshed after a push added lines above it points at the wrong line once the page reloads (BSERV-19539, long-term backlog). Reload the pull request before suggesting.
- An empty line (Data Center 9.3.0). A suggestion on an empty line showed as a plain code block instead of a suggestion; fixed in 9.3.1 and 9.4.0 (BSERV-19714).
Reading suggestions in IntelliJ IDEA
Pull Request Inbox for Bitbucket, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a pull request's comment threads in an IDE tool window and at their lines in the diff, from Bitbucket Cloud and, in beta, from Bitbucket Data Center 8.9 or later. From version 1.0.33, a ```suggestion block in a comment on lines says above it which lines it replaces, or that it deletes them when it is empty, and that Apply suggestion on the pull request page takes it; from 1.0.34 that includes suggestions on several lines on Data Center 9.3 and later. From 1.0.35, a comment written in its diff on several selected lines covers all of them on Data Center 9.3 and later (before, only the last one), so a suggestion written there replaces the whole range. The plugin does not apply suggestions itself. The review inbox, diffs, discussions and merge checks are free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).
Get it on JetBrains Marketplace
Bitbucket and Atlassian are trademarks of Atlassian; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by Atlassian or JetBrains.
More: Rovo Dev code review · find every pull request waiting for your review · Bitbucket merge checks · pre-receive hook declined · Bitbucket pull request plugins for IntelliJ IDEA, compared · 日本語