Integrate with TeamCity
If you are working on a software development project and are using TeamCity, there are some useful integration features that can reduce the amount of duplicated effort that is performed by your team. The integration between YouTrack with TeamCity enables useful features in both applications:
- YouTrack pulls build numbers from connected projects.
Issues that were resolved after the last known successful build are automatically assigned the build number of the next successful build.
This value is added to a custom field that stores the build number for each resolved issue.
You can specify whether issues that are mentioned in commmit messages and build comments are assigned build numbers and use a search query to assign build numbers to issues that match specific criteria.
- Your developers reference an issue ID in the comments when they commit updates to the code repository.
The TeamCity integration adds a direct link to the YouTrack issue in the change details.
The comment is automatically added to the list of changes on the VCS Changes tab in the YouTrack full page view. Each VCS change includes a direct link to the change details in TeamCity.
- Your developers can enter commands in the comments for their commits in TeamCity. When TeamCity assembles a build that contains the commit message, the command is applied all of the issues that are referenced in the command. You can use this feature to update the status or add comments to one or more issues without even opening YouTrack.
Before you start, verify the following requirements:
- Your YouTrack administrator has enabled the TeamCity integration for your YouTrack server and has configured the connection to a TeamCity server.
- You have a user account in TeamCity that is assigned the Project Administrator role in the projects that you want to integrate with YouTrack. If your TeamCity server uses simple authorization mode, Administrator permissions are required.
- The YouTrack project that you want to integrate with TeamCity uses a custom field that stores a value as a build type.
You can use the default custom field Fixed in build or any other custom field that stores a build type.
If you don't want to add build numbers to issues, you can enable the integration without mapping build numbers to a custom field in YouTrack. In this case, your developers can still mention issues and apply commands in VCS commit messages.
Define the Mapping Between Projects
To enable the TeamCity integration in your project, you map your YouTrack project to a build configuration in TeamCity.
The first group of settings connect YouTrack to a build configuration for a project on a TeamCity server. Additional options for the default and feature branches let you define which issues are assigned build numbers for each branch. You can also specify the commands to apply to all of the issues that are processed by YouTrack.
To define a mapping between YouTrack and TeamCity:
- Click the Projects link in the header and select your project.
- Click the Edit project link.
- Select the TeamCity Integration tab.
- Click the Create New Mapping button.
- Enter values for the following settings:
- Click to expand the Actions for Default Branch settings. These settings determine which actions are applied to builds in the default branch. If you don't want to add build numbers to issues, continue from step 9.
- Configure the following options:
- Expand and set the options for the Actions for Feature Branches settings. These settings determine which actions are applied to builds in one or more feature branches. Each setting provides the same functionality as described for the default branch, above.
- If you want to restrict the visibility of comments and updates on the VCS Changes tab, select one or more groups from the Visible to drop-down list. Otherwise, the list of changes that are displayed on this tab is visible to any user who has permission to read issues in the project.
- Click the Create mapping button.
You can use placeholders in the Query and Command settings. These placeholders reference attributes that are stored for builds in TeamCity. The placeholder is replaced with the corresponding value in the connected version control system when the builds are processed by YouTrack. The following placeholders are available: