Bitbucket pull requests in VS Code

Atlassian for VS Code is published as an Atlassian Labs project. Although you may find unique and highly useful functionality in the Atlassian Labs apps, Atlassian takes no responsibility for your use of these apps.

Within the Atlassian sidebar, the VS Code extension provides a tree view displaying the Bitbucket pull requests, pipelines, and issues of each repository connected to your current Bitbucket account. 

The tree views (explorers) can be disabled/enabled from Atlassian Settings. You can also configure how often the tree views auto-refresh and the frequency of new pull request notifications. You can also manually refresh the tree views at any time by clicking the refresh icon on each tree view's title bar.

View and modify a Bitbucket pull request from VS Code

  1. Select the Atlassian logo on the leftmost sidebar in VS Code. This opens the Atlassian sidebar which displays any Jira issues and Bitbucket pull requests, pipelines, and issues connected to your current Bitbucket or Jira account. These panels should be displayed by default; if not, click on the title bar of each one to open and display issues, pull requests or pipelines.

By default, the Atlassian sidebar view shows all open pull requests, but you can change the filter to display only the pull requests you’ve created or the pull requests waiting for your review.

2. Click the Details under the pull request you want to view or modify. 

The pull request details screen not only provides the details about the specific pull request, but also the ability to comment, approve, checkout, and merge the pull request.

pull request details screen with 1 through 9 call outs
  1. Linked Pull Request Path - Click the linked pull request path in the upper-left corner to open the pull request with Bitbucket in your browser.

  2. Approve - Click Approve in the upper-right corner to immediately approve the pull request.

  3. Merge - Click Merge in the upper-right corner to immediately merge the pull request.

  4. Open in Bitbucket - Click the Bitbucket logo in the upper-right corner to open the pull request with Bitbucket in your browser.

  5. Checkout source branch - Click Checkout source branch under the Approve button to checkout the branch for the pull request on your local machine.

  6. Build Status - Click the build status icon to get details of the latest build.

  7. Related Issues - The list of issues related to this pull request. Click the issue to open the Issue Details screen.

  8. Commits - The list of commits to this pull request. Click the commit to open it with Bitbucket in your browser.

  9. Comment - Type a comment and click Save to add a comment to the pull request.

Create a Bitbucket Cloud pull request from VS Code 

From the command palette

  1. Open the command palette by executing the following Atlassian: Open Settings command: Command + Shift + P (on Mac) or Ctrl + Shift + P (on PC) and search for Create pull request.

  2. From the command palette: choose the Atlassian: Create Pull Request command.

  3. Fill in or update any fields on the Create pull request form.

  4. Click the Create pull request button in the lower-left corner.

From the Bitbucket pull requests tree

  1. Click on the Atlassian logo on the leftmost navigation bar.

  2. Click on the BITBUCKET PULL REQUESTS heading on the Atlassian status bar.

  3. Click on the to open the a new Create Pull Request form.

  4. Fill in or update any fields on the Create Pull Request form.

  5. Click the Create pull request button in the lower-left corner.

You can also right-click on any line in the source code editor to open the context menu and select Create Pull Request.

Once the pull request is created, the Pull Request Details screen for it will be opened up in VS Code. Notifications will also appear in VS Code for everyone that has the repository connected to their workspace.

Pull request context menus 

The extension provides a few useful right-click context menus related to Bitbucket pull requests.

  • Copy Pull Request Url to Clipboard - copies the url for the pull request to your clipboard for easy sharing. 

  • Create Pull Request - opens the Create Pull Request screen.

  • Open Changeset - opens the changeset with Bitbucket in your browser

  • Open in Bitbucket - opens the pull request with Bitbucket in your browser

  • View Pull Request - opens the Pull Request Details screen

Additional Help