Tweet
Working on a project often means working with issue tracking. There are various issue tracking systems out there: YouTrack, JIRA, FogBugz
and more. Many projects use the issue tracker which comes with GitHub. PhpStorm comes with built-in support for many of these issue
trackers. It even provides "generic" issue tracker integration which provides integration with other issue trackers like Drupal's. In this tutorial,
we'll explore how we can work with issue tracking systems in PhpStorm.
Introduction to Working with an Issue Tracking System in PhpStorm
Enabling Integration with an Issue Tracking System
Enabling Integration with a Specialized Issue Tracking System
Linking Issues with Source Control
Enabling Integration with a Generic Issue Tracking System
Working with tasks
Once an issue tracking server has been added, we can browse our list of issues, correlate VCS commits with issues and tasks, create new tasks
and so on. The Tools | Tasks & Contexts | Open Task... menu or the Alt+Shift+N keyboard shortcut will list available tasks and provides the
starting point to creating a new task.
When we select a task (or press Enter), we are asked if we want to clear the current working context. If our project is connected to a VCS, the
IDE will suggest creating a new branch to work on the task.
We can make our changes and commit them to the VCS. Note that PhpStorm will automatically populate the commit message with the task id and
description (if enabled in the settings, more on that later).
Once work on the task is completely finished, we can use the Tools | Tasks & Contexts | Close Active Task... menu (Alt+Shift+W). This will
close the current context in the IDE and, when we tick the checkboxes, commit changes and optionally merge the branch that was created.
In the next sections of this tutorial, we'll dive deeper into how we can connect to the various issue trackers and how we can work with tasks.
The YouTrack provider comes with completion for fields and values in queries.
More information on connecting to YouTrack and the various configuration options can be found in the YouTrack documentation.
The following example lists settings for connecting to a GitHub issue tracker
Once we entered the connection details, we can click the Test button to check connectivity with the issue tracker.
Check the web help for more information about the available placeholders.
For generic issue trackers, we will have to configure several other options on the Server Configuration tab. For starters, we will have to specify the
URL to the issue list. For Drupal, we can enter the path to the issue tracker (using {serverUrl} as a placeholder for the previously configured
server URL). This could be:
All open issues: {serverUrl}/project/issues/search/?status=Open&priorities=All&categories=All
All issues assigned to me: {serverUrl}/project/issues/search/?assigned=YOUR DRUPAL.ORG USERNAME&status=Open&priorities=All&
categories=All
We also have to specify the data type (in this case, "text" as our data is free-format HTML) and a regular expression to filter out issue numbers
and description. Based on the HTML output from the previous URL, we can use this one:
Using the Test button, we can verify our settings are correct. In our IDE we can make use of the Alt+Shift+N keyboard shortcut to list issues.
Using the Tools | Tasks & Contexts | Show <task ID> Description, we can look at the task's description The Alt+Shift+B keyboard shortcut
will open the task in a browser window.
When multiple tasks have been opened, we can switch between tasks using the Alt+Shift+T keyboard shortcut or the toolbar.
Each task can be opened in a separate task context. This allows us to work with and switch between several tasks at a time without
mixing the changes that were made between both tasks. Read more on task contexts and changelists in our web help.
Once a task has been completed, we can commit source code to our VCS. If we have opened a task from the issue tracker, PhpStorm will
populate the commit message based on the template specified in settings.
Tweet