Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

On this page:

Table of Contents

Info

This feature is available for Jira Server only.

Starting from version 2.2.0, TeamCity Integration for JIRA add-on Jira app allows you to manage the TeamCity Build Runner custom field. It allows you to remotely run builds on TeamCity server from JIRAJira.

Before proceeding to configuration of this custom field, please refer to the documentation about management of custom fields in JIRAJira.

Adding a Custom Field

  1. Navigate to JIRA Administration > Issues > Fields > Custom Fields.
  2. Click Add Custom Field.
  3. In the Select a Field Type form, switch to view all custom fields and enter 'TeamCity' into the search field.
    Image RemovedImage Added
  4. Select TeamCity Build Runner field.
  5. Click Next.
  6. Specify the field name and its description.
  7. Click Create.
  8. Select the screens where you want to display this field.
  9. Save the configuration.

...

  1. Locate the newly added custom field and click the cogwheel button.
    Image RemovedImage Added
  2. Click Configure.
  3. On the opened page, click Edit Default Value.
    Image RemovedImage Added
  4. Select the appropriate TeamCity server, project and , build configuration and branch. You can also add an optional comment and define the build parameters.
    Image RemovedImage Added
  5. Optionally, you can allow users to view and edit the comment appended to the build. You can also allow users to view and edit properties which the build is triggered with.
  6. Click Set Default.

Once you have configured and added the custom field, you can remotely run builds in TeamCity from JIRAJira.

Info

Users will be able to change the default branch configured for the field once they decide to run a build in an issue.


Adding Build Parameters into Custom Field Configuration

...

For example, if you want to add one parameter with the value so you have to specify the following:


 

Code Block
languagepowershell
teamcity.buildagent.branchname=yourteamcity_vcsagent_branch_name
# This build parameter defines which branch to choose for build creation. It may look like: teamcity.build.branch=2.2.0
If you want to add multiple parameters, you need to use the ';' (semicolon) as a separator for multiple parameters, as follows:
Code Block
languagepowershell
teamcity.agent.name=Windows2012R2;issue_key=$JIRA_KEY

If you want to run a chain of linked builds within the same branch but from a different build configuration, use the following parameter in the property set:

Code Block
languagepowershell
reverse.dep.*.teamcity.build.branch=2.2.0branch.name=$BRANCH_NAME

If you want to pass the issue key to TeamCity for mapping the build to the specific issue, add the following property:

Code Block
languagepowershell
issue_key=$JIRA_KEY


Info

For the list of accepted build parameters, see TeamCity documentation.


Info

The teamcity.build.branch parameter (if used not for a chain of linked builds) is deprecated since TeamCity Integration for Jira 2.7.0 and will be ignored.