Create Jira issues in VS Code

Here are several ways to create Jira issues from the Atlassian for VS Code extension.

The extension provides in-code links to create issues which are triggered from configurable keywords. By default, the extension ships with the following keywords configured: TODO, BUG, FIXME, and ISSUE.

Here's how you do it
  1. Click on the line where you want to add your in-code link.
  2. Add your in-code link and provide some context. For example, // TODO: this needs to be fixed. The message you provide after the in-line code becomes the Jira issue's subject line.
  3. The extension will prompt you to create a Jira issue. Click Create Jira issue which appears above the line you just added in Step 2.
  4. Fill in or update any fields on the Create Issue form.
  5. Click Submit.

Once the issue is created, the comment will be replaced to show information about the issue.

These triggers can be configured on the Atlassian Settings screen.

Create an issue from context in VS Code

Another way to create an issue is by using the right-click context menu from anywhere in your code. Not only will this bring up the create issue screen, but it will also drop a link to the source code in Bitbucket with the exact line that was clicked into your issue’s description field. If you highlight multiple lines, the link will contain the range of lines selected.

Here's how you do it
  1. Right-click on the line or highlight multiple lines and right-click on the range of lines you selected to open the right-click context menu.
  2. Select Create New Jira issue from the list of menu items. The line or lines that you selected will be displayed in the Description field of the new Jira issue.
  3. Fill in or update any fields on the Create Issue form.
  4. Click Submit.

If you are not using Bitbucket but another source control system (for example GitHub), a relative path with the line number range will be dropped into the description field.

Create an issue manually from VS Code

You can also create an issue without associating it with a line of code.

Here's how you do it

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 New Jira Issue.
  2. From the command palette: choose the Create New Jira Issue command.
  3. Fill in or update any fields on the Create Issue form.
  4. Click Submit.

From the Jira issue tree

  1. Click on the Atlassian logo on the leftmost navigation bar.
  2. Click on the JIRA ISSUES heading on the Atlassian status bar.
  3. Click on the + to open the a new Create Issue form.
  4. Fill in or update any fields on the Create Issue form.
  5. Click Submit.

Create Issue screen in VS Code

Atlassian for VS Code supports many common Jira fields. Unfortunately, it’s not always possible to render complex custom fields contributed by various Jira plugins within the confines of VS Code.

In cases where an issue type contains a field that cannot be rendered, one of two things will happen:

  • If the field is not required, the field will simply not be shown.

  • If the field is required, the issue type is removed as an option entirely.

tip/resting Created with Sketch.

After the issue is created, the summary and description fields will be reset to blank with all other fields remaining with the previously selected options. This allows you to create multiple issues in rapid succession just like the “create another” option within Jira itself.

This is useful if you're doing a planning session and need to create a lot of issues with similar field values.


View and modify Jira issues

Learn the multiple ways within VS Code to open and update the details of a Jira issue.

Here's how you do it

Click on an issue in an issue tree

If you’re looking through the list of issues in an issue tree, simply clicking on an issue will bring up the issue details screen.

Use the Command Palette

If you know the issue key you want to open, you can quickly open the details screen 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).
  2. Search for 'open Jira issue' and select Atlassian: Open Jira Issue

An input box is displayed where you can type in your issue key and hit enter to open the details.

Issue Hovers

The extension includes support for Issue Hovers.

  1. Hover over an issue key anywhere in your code (usually in code comments) and you’ll get a quick view modal for the issue.
  2. Within the modal, click the Open Issue View link to open the full issue details screen.

Issue hovers can be disabled/enabled in the Atlassian Settings screen.

Start work with Jira issues

The Start work on issue feature performs all the steps required in Jira and Bitbucket so you can start coding.

Before you begin using this feature:

  • Assign the issue to yourself

  • Create a new branch for the issue, containing the issue key and branch name

  • Checkout the new branch locally and link it to the remote repository branch

  • Transition the issue to 'In progress' 

To use the feature:

  1. Double-click an open issue you would like to start working on from the Open Issues list on the Atlassian status bar.
  2. Click the Start work on an issue button to access the issue.

Once you select the Start work on an issue button, the following occurs:

  • the issue is assigned to you
  • the issue is transitioned to whatever state you selected
  • a branch is created with the issue key in it's name
  • a branch is checked out locally
  • a branch has its upstream set to the remote branch

When you put an issue key in your branch name you can see and interact with issues similar to the way you would in Jira Software within the Bitbucket Cloud interface. Learn more

tip/resting Created with Sketch.

Including issue keys in every commit message is also a good idea. Not only do these get automatically linked in the Bitbucket interface, but it also helps the VS Code extension find issues related to commits and pull requests.

Never forget an issue key again

We’ve made it super simple to include your Jira issue keys in your commit messages without ever having to type one in or even remember what the key is. When you create a branch with the issue key in its name, you can use a git prepare-commit script to automatically add the issue key from the branch name into every commit comment.

Don’t know how to write a prepare-commit script? No worries, we’ve got you covered:

bitbucket.org/snippets/atlassian/qedp7d/...