Link Issues in VCS Commits
Software development teams often apply changes to the application code in response to an issue. These updates are usually applied in a version control system, or VCS. When you commit code to a VCS repository, you have the option to add a comment to the commit that explains what you changed and why.
If your YouTrack server is integrated with a VCS repository, you can reference issues in your VCS commit comments. These references are transformed into links that point from the repository, build, or commit to the issue in YouTrack. This feature is supported by the following integrations:
Build Server Integrations (TeamCity, Jenkins)
- Upsource Integration
VCS Integrations (GitHub, Bitbucket, and GitLab)
Build Server Integrations
When your YouTrack server is integrated with TeamCity, you can reference issues when you commit changes to the version control system that is attached to your build server. To reference an issue, simply mention the issue ID in your comment. For example,
TeamCity transforms the issue ID into a link to the corresponding YouTrack issue. When you move the pointer over the down arrow icon after the issue ID, a tooltip displays the issue summary and key fields:
In YouTrack, a link to the Change details page in TeamCity is added to the issue. All related commits are displayed in the activity stream.
When your YouTrack server is integrated with Upsource, you can also reference issues when you commit changes to the code repository. Again, just mention the issue ID in your commit message.
Upsource transforms the issue ID into a link to the corresponding YouTrack issue. When you move the pointer over the issue ID, a tooltip displays the issue summary and key fields:
Upsource also transforms issue IDs to links when you add them to comments in a code review.
In YouTrack, a link to the related commits and code reviews in Upsource are added to the issue. All related changes are displayed in the activity stream.
A direct integration with a version control system lets you create links in the following ways:
Reference YouTrack issues in your commit messages to create links from the VCS to YouTrack.
Paste commit hashes into an issue summary, description, comment, or string-type custom field to create links from YouTrack to the VCS.
Matching VCS Commit Authors and YouTrack Users
To link VCS changes and process commands in commit messages, YouTrack has to find a user account that matches the author of the commit message. If a command is specified in the commit message, it is applied based on the access permissions that are granted to the user account in YouTrack. The user account is identified in different ways based on the type of connection to the version control system.
YouTrack checks the email address that is stored in the TeamCity user profile of the user who committed changes to the VCS. To recognize the TeamCity user who committed the change, the VCS user name should be associated with the user profile in TeamCity.
This integration is supported by connecting to an external Hub that manages user accounts for both Upsource and YouTrack. The command is applied in YouTrack by the same user who entered the command in the VCS commit message.
For VCS integrations, the ability to apply commands to issues is limited to users who are members of the Committers group in the VCS integration settings.
If the author of the commit message cannot be found in YouTrack, the command is not applied. The user name is shown in red text on the VCS changes tab. The warning tooltip provides information that you can use to fix the problem.
There are basically two things that users can do to fix this problem:
Use the same email address for their accounts in YouTrack and the integrated VCS.
Add their name (or nickname for Bitbucket) to the list of VCS user names in their Hub accounts.