How to integrate TeamCity 10 and Jira

May 12, 2016
#How To#Jira#Integration
12 min

Connect your Bitbucket to the TeamCity CI/CD server with TeamCity Integration for Bitbucket to run builds right from Bitbucket in one click, view build results, logs and artifacts right next to your code, and never lose time switching.

Atlassian JIRA has become, probably, the most popular bug tracker solution. It’s not surprising because it has a powerful set of features, flexible configuration and can be integrated with a variety of other solutions (especially developed by Atlassian). JIRA allows you to create different solutions for different tasks. It can be used for tracking simple home or family tasks (with a 10-user license that costs only $10), it can be also used for building a full-fledged enterprise task management and bug tracking solution with service desk. JIRA, starting from version 7, represents a platform for different applications. At the moment, there are three applications:

– JIRA Core – basic version of JIRA for tracking the tasks in the simple projects
– JIRA Software – old good JIRA that we know – with all its essentilal capabilities, including Kanban and Scrum
– JIRA Service Desk – service desk solution by Atlassian based on JIRA

TeamCity – one of the common and well-proven CI-solutions from JetBrains. It can be used by small teams of developers (there is a free version of TeamCity for small instances), but it also can be used as an enterprise CI-solution for the large companies. TeamCity allows you to automate build, test and deploy workflows.

We’re  using in StiltSoft both JIRA and TeamCity for a development process. We’re updating our JIRA and TeamCity instances every time when a new version is available and we haven’t had any problems yet. JIRA 7 was released by Atlassian last year, and now JetBrains team is preparing TeamCity 10 to release (EAP already available). Let’s sort out what’s new in TeamCity 10.

What’s new in TeamCity 10

There were announced a lot of improvements in TeamCity 10, let’s check out the most interesting changes.

Default settings for checkout of source code were changed

Now your sources will be checked out right on the agent. This feature should reduce your TeamCity server load. This affects only new build configurations, all your current configurations will not be changed.

Java 8 is now required for the server and recommended for the agent

This helps JetBrains to develop new features without supporting deprecated versions of Java. In general, usage of old or deprecated software is a bad idea.

Cloud support was extended. Now TeamCity supports not only Amazon Cloud, VMWare vSphere is supported too

It’s a very useful improvement. There are a lot of companies with a strict security policies, so they can’t allow Internet access to their CI-servers. These companies usually have their own virtualization infrastructure, VMWare is a well-known and widely used solution in the world – so its enterprise customers will be happy to use their own Cloud in a flexible manner to save their money and resources.

The settings are similar to Amazon Cloud settings – you can restrict a number of your Cloud agents, also you can shut down the agent immediately after build completion or wait some time before its shutdown (this can be useful when your TeamCity has a lot of builds in the queue).

VCS integration has been improved

GitHub Issue Tracker Integration is now available out of the box. JIRABugzilla and YouTrack (native issue tracker software from JetBrains) integration is also supported.

Commit Status Publisher (distributed separately before) has become a part of TeamCity 10. Now you can inform Atlassian Bitbucket (server and cloud), Gerrit and GitHub of status of your build.  We have written a separate post about TeamCity and Bitbucket integration, you can read how it works.

Improved notifications

New TeamCity has got an ability to notify the user if his or her changes has broken the build. The Notification Rules screen was changed too, it became more descriptional. In TeamCity 9 this screen looked like this:

In TeamCity 10 the Notification Rules screen looks like this:

Deployer plugin has been included in Teamcity

This plugin allows you to copy files that you need (artifacts, for example) to the remote server using FTP, SFTP, SCP, SMB protocols during the build execution. It also can be used to run shell commands on a remote server.

UI performance has been improved

It’s really important for large TeamCity instances. We also like a console view feature that has been included in TeamCity 10. You can switch to the dark color scheme to view build log in a more comfortable manner if you like a console view, of course (smile)

How to integrate TeamCity 10 and JIRA

The most common use case for JIRA is a bug tracker, and it’s really a killer feature of JIRA. Out-of-the-box JIRA displays a task details and user comments, but in many cases developer teams need more information. A developer task usually finishes by commit into VCS repository that triggers a build on the CI server. If you’re using TeamCity as a CI server – you can easily integrate it with JIRA using TeamCity Integration for JIRA add-on that you need to install in JIRA. Integration process is quite simple and is fully described in the documentation.

The add-on displays information about status of the builds in TeamCity and shows the latest TeamCity activity. This information is provided by the gadgets that can be added to the JIRA dashboard. Issues in JIRA will also receive the additional TeamCity tab showing extended information about the associated builds.

TeamCity Build Configurations

This gadget allows users to quickly see the build status for the selected build configurations. You need to specify the refresh period and the build configurations you want to see.

You can see your builds status after you configure the gadget and you have also a capability to remotely trigger builds in TeamCity by clicking the plus icon.

TeamCity Agents

TeamCity build agents will be displayed with this gadget. This gadget will show the list of currently available agents with their connection statuses. If integrating JIRA with multilple TeamCity servers, you will have a capability to select the appropriate TeamCity instances for showing available agents.

TeamCity Activity

This is a gadget for JIRA dashboard that displays an activity feed from TeamCity. Activity can be filtered by the build status, by project and by time period.

As a result you will have the continuously updated activity feed from Teamcity on your JIRA dashboard.

You can click the down arrow link and view changes directly in TeamCity.

TeamCity tab in issue and project views

Information about the related builds will be displayed when the build indexation is completed by the add-on.

You can filter the events by status, build period, build agent or project if you need.

The way towards the perfection

We’ve already described how to integrate TeamCity and Bitbucket instances, and today we have described how to integrate TeamCity 10 and JIRA. When you integrate all the instances of TeamCity, Bitbucket and JIRA you will receive a handy set of development tools. But this is not all. If you add a JIRA integration with Bitbucket to this set – you will receive a real Swiss knife for your development process.