Jira issues in VSCode
You can use Atlassian for VSCode to create, modify, assign, and begin working with Jira issues.
Create Jira issues in VSCode
Here are several ways to create JIRA issues from the Atlassian for VSCode extension.
From in-code links
The extension provides in-code links to create issues which are triggered from configurable keywords.
For example, if you add the following code comment the extension will prompt you to create an issue:
// TODO: this needs to be fixed
Once created, the comment will be replaced to show information about the issue
By default, the extension ships with the following keywords configured:
These triggers can be configured in the Atlassian Settings screen
Create an issue from context in VSCode
Another way to create issues 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.
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 VSCode
You can also create an issue without associating it with a line of code.
To do so, you have 2 options:
From the command palette: choose the Create New Jira Issue command
From the Jira issue tree: click the + button
Create issue screen in VSCode
To create an issue, just fill out the fields as needed and click the submit button. After you create the issue you see a confirmation message with a linked issue key.
In the main area of the screen you’ll find the most commonly used fields in Jira. These fields behave the same way as they do in Jira as well, meaning you can do things like create a new version right within the Fix Version/s drop down, or search for previously used labels in the Labels drop down.
Under the main area, you’ll find an Advanced Options button, that when clicked, will show you the rest of the fields (if any) available to the selected issue type.
We’ve tried to support as many fields as possible that are available in Jira. Unfortunately it’s not always possible to render complex custom fields contributed by various Jira plugins within the confines of VSCode.
In cases where an issue type contains a field we can’t render we do one of two things:
If the field is not required, we simply don’t show the field
If the field is required, we remove the issue type as an option entirely
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 your 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 VSCode to open and change the details for a Jira issue.
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:
Open the command palette by typing CTRL+Shift+P
Start typing “open Jira issue” and select Atlassian: Open Jira Issue
You’ll now get an input box where you can type in your issue key and hit enter to open the details.
The extension include support for “Issue Hovers”. This means you can hover over an issue key anywhere in your code (usually in code comments) and you’ll get a quick view popup for the issue. Within the hover, you can click a link to open the full issue details screen.
issue hovers can be disabled/enabled in the Atlassian Settings screen.
The Issue Details Screen
The issue details screen provides details about an issue as well as the ability to comment on the issue, change the issue status, assign the issue to yourself.
Linked Issue Key - click the key to open the issue with Jira in your browser
Start Work on Issue - see the next section: Start Work on Jira Issues
Status - select a status from the drop down to immediately update the issue status in Jira
Add a comment - type a comment and click save to add a comment to the issue
Assign to me - click the button to immediately assign the issue to yourself
Recent Pull Requests - Shows pull requests this issue is mentioned in and gives you a link to open the pull request details screen. see: Bitbucket pull requests in VSCode
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:
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 an “in progress” state
To use the feature:
Open a Jira issue in VSCode, see View and modify Jira issues
Double click on an issue to open it
Click on the “Start work on issue” button.
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 In Bitbucket Cloud interface. Edit, comment, add attachments, transition, watch, and much more.
Putting issue keys in every commit comment is also a good idea. Not only do these get linked in the Bitbucket Cloud interface, but it also helps our VSCode extension find issues related to commits and pull requests.
Never forget an issue key again
We’ve made it super simple to get your Jira issue keys into your commit comments without ever having to type one in or even remember what the key is…
When you create a branch with the issue key in it’s 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: