TeamCity On-Premises 2022.10 Help

Integrating TeamCity with Jira

TeamCity integration with Jira allows:

  • Displaying links to Jira issues in the TeamCity UI — applicable to self-managed Jira (Data Center and Server 4.4 or later) and Jira Cloud.

  • Reporting TeamCity build statuses to Jira Cloud.

This article describes how TeamCity behaves when integrated with Jira and contains instructions on how to enable and configure the integration.

Displaying Links to Jira Issues in TeamCity UI

When integration with Jira is enabled, TeamCity automatically detects Jira issue keys mentioned in the comments of VCS commits. It transforms these keys into links to the corresponding issues in Jira and displays them to TeamCity users in the UI.

To see the basic details of an issue in the TeamCity UI, open the Changes tab of the related build’s results and hover over the icon next to the issue key:

Issue tracker integration

Issues fixed in the build can be viewed on the Issues tab of the build results:

Issues tab

To view issues related to a whole build configuration (not only to individual builds), use the Issue Log tab of the Build Configuration Home page. You can filter the list to a particular range of builds and/or enable the Show only resolved issues option to display only issues fixed in the builds.

Issue log

Follow these recommendations to get the maximum benefit from the Jira integration:

  • When committing changes to your version control, always mention the issue key related to the fix in the comment to the commit.

  • Mark fixed issues as Resolved in Jira to display them with the Fixed status in TeamCity logs (the time of resolve does not really matter).

TeamCity updates statuses of Jira issues displayed for builds every 10 minutes or when new commits are detected.

Configuring Connection to Jira

To enable the integration, create a connection to Jira on the Project Settings | Issue Trackers page and specify the following settings:

Setting

Description

Connection Type

Select Jira from the list.

Display Name

Specify the connection name to distinguish it from the other connections.

Server URL

Enter the base URL of your Jira instance or server. For Jira Cloud, it is a URL like https://XXX.atlassian.net.

Login

A username for self-managed Jira (specified in the Jira user profile) or email for Jira Cloud.

Password / API Token

A password for self-managed Jira or API token for Jira Cloud.

Project Keys

Enter a space-separated list of project keys to specify which strings should be recognized as references to issues in Jira. For example, if a project key is WEB, an issue key like WEB-101, mentioned in a VCS comment, will be turned into a link to the corresponding issue.

You can also load all project keys automatically: enable Use all Jira projects automatically and test the connection to your Jira server. If the connection is successful, the Project Keys field will be automatically populated. TeamCity will detect newly created projects in Jira and automatically synchronize the list of project keys.

Note that a user specified in the connection to Jira should have sufficient permissions to view Jira issues. This will allow TeamCity to retrieve the information about issues and display it in the UI.

Reporting TeamCity Build Statuses to Jira Cloud

TeamCity can report build statuses to Jira Cloud in real time. If you mention a Jira issue key in a VCS commit message, TeamCity will detect this message when running the build that contains this commit. The build status will be sent to Jira Cloud and displayed in the Jira task details.

TeamCity build status in Jira Cloud

You can click the status to see more information on the Builds (for regular and composite builds) or Deployments (for deployment builds) tab.

Jira Deployments tab

Enabling Feature

To make TeamCity send build/deploy information to Jira Cloud:

  1. When configuring a connection to Jira Cloud, specify the Jira Cloud Client ID and Server secret settings.

  2. Add the Jira Cloud Integration build feature to a build configuration, and select the preconfigured connection to Jira Cloud.

    For a deployment build configuration, specify an environment type (for example, testing or production) and an environment name. These options are required to show the deployment information in Jira Cloud.

TeamCity Integration with Jira Cloud Video Guide

Last modified: 28 March 2022