Mapping External Links in Comments
Last modified: 20 April 2023Mapping External Links in Comments
TeamCity allows to map the issues in comments of the users' commits in the version control system using the search and replace pattern.
To configure mapping:
Navigate to the file
<TeamCity Data Directory>
/config/main-config.xmlLocate section < comment-transformation >, or create one under the <server> tag, if it doesn't exist (you may refer to the main-config.dtd file for the XML structure definition)
Specify the search and replace patterns. For example, you can use the following pattern for enabling JIRA integration:
<server> ... <comment-transformation> <transformation-pattern search="(>|\(|\s|^)([A-Z]+-\d+)(\b|$)" replace="$1<a target="_blank" title="Click to open this issue a new window" href=" http://www.jetbrains.net/jira/browse/$2">$2</a>$3" description="JetBrains Jira issue link" /> </comment-transformation> ... </server>
NOTE Search & replace patterns have java.util.regex.Pattern syntax.
Thanks for your feedback!