Why Integrate YouTrack with TeamCity?
Integrating YouTrack with TeamCity 5.0+ has two major advantages:
- Whenever an issue has been closed after last known successful build but before a new successful build, TeamCity integration fills the issue's 'fixed in build' attribute with the exact number of the new successful build once it has been assembled:
- If an issue ID is referenced in a VCS commit, TeamCity integration adds a link from the issue to the list of version control changes:
These changes are shown under the TeamCity Changes tab in full issue view:
YouTrack pulls fresh data from TeamCity every minute.
How to Configure TeamCity Integration?
- Make sure that you have updated your TeamCity installation to version 5.0 (you can download EAP builds).
- If you use TeamCity 5.0 EAP build 10642 or later (including TeamCity 5.0 release build), skip this step.
If you use an earlier TeamCity 5.0 EAP build, download and install an appropriate version of REST plug-in for TeamCity:
- In YouTrack Admin area, click TeamCity Integration.
- In the TeamCity Integration tab, click Enable TeamCity Integration:
- Enter TeamCity installation URL and your TeamCity credentials.
- Click Save.
You should define mappings between YouTrack projects and TeamCity projects. To configure a mapping:
- In the TeamCity Integration tab, click Define mapping.
- In the TeamCity Mapping dialog box, do the following:
- In the Project drop-down list, select a YouTrack project.
- In the TeamCity Project drop-down list, select a TeamCity project.
- In the TeamCity Build drop-down list, select a build configuration for the selected TeamCity project.
- To specify which user groups should be able to use TeamCity integration, click Restrict Access. In the Visible for Groups combo box, choose groups that will be allowed to use TeamCity integration:
- Click Save.
Project mappings that you have created are displayed in a table on the TeamCity Integration tab:
How to Use TeamCity Integration?
- To map issues to change commits: When you're committing changes associated with an issue to your version control system, specify an issue ID in a comment to your commit, like this:
TeamCity will transform the issue ID into a link to the corresponding YouTrack issue, and copy its summary right into the comment:
On the other hand, a link to the associated change commit will be created in the YouTrack issue, visible on the TeamCity Changes tab in full issue view:
- To replace "next build" with a specific build: When you have resolved an issue and you want YouTrack to map it to the next build assembled by TeamCity, you don't have to do anything special - the "Fixed in build" attribute of any issue gets the value of "Next build" by default. Once you've fixed the issue and TeamCity has assembled a new build containing changes associated with the fix, the exact build number automatically replaces the default "Next build" value.