View Source

{toc:style=disc|indent=20px|maxLevel=5}

h2. 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:
!teamcity_build_replace.png|thumbnail!
# 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:
!commit_in_teamcity.png|thumbnail!
These changes are shown under the _TeamCity Changes_ tab in full issue view:
!teamcity_changes.png|thumbnail!

{hidden-data}When you resolve an issue, it is by default marked to be implemented in "Next build". When the next build is assembled, the attribute value changes to an exact build number.{hidden-data}

YouTrack pulls fresh data from TeamCity every minute.

h2. How to Configure TeamCity Integration?
h3. Initial Configuration
# Make sure that you have updated your TeamCity installation to version 5.0 (you can [download EAP builds|http://www.jetbrains.net/confluence/display/TW/TeamCity+EAP+(Latest)]).
# *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:
** [REST API plugin v.51|http://www.jetbrains.net/confluence/download/attachments/16974232/rest-api.zip] (known to work with TeamCity 5.0 EAP builds up to build 10455.)
** [REST API plugin v.54|http://www.jetbrains.net/confluence/download/attachments/16974232/rest-api-54.zip] (known to work with TeamCity 5.0 EAP build 10522.)
{tip}
See [TeamCity help|http://jetbrains.net/confluence/display/TCD5/Plugins+Packaging] for plug-in installation guidelines.
{tip}
# In YouTrack Admin area, click *TeamCity Integration*.
# In the *TeamCity Integration* tab, click *Enable TeamCity Integration*:
!teamcity_integration__tc_credentials.png|thumbnail!
# Enter TeamCity installation URL and your TeamCity credentials.
# Click *Save*.

h3. Mapping Projects
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:
!teamcity_mapping.png|thumbnail!
## Click *Save*.
Project mappings that you have created are displayed in a table on the *TeamCity Integration* tab:
!jetbrains_teamcity_mappings.png|thumbnail!

h2. 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:
{{fixed YP-2046}}
TeamCity will transform the issue ID into a link to the corresponding YouTrack issue, and copy its summary right into the comment:
!commit_comment.png|thumbnail!
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:
!teamcity_changes_list.png|thumbnail!
* *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.

{hidden-data}
reset?
start sync?
refresh?
{hidden-data}