WebStorm 2021.2 Help

VCS integration with issue trackersVCS与问题跟踪器的集成

With WebStorm, you can connect your commit messages with a bug tracker or an issues data base, and navigate from commits in your VCS log to issues related to these commits.使用WebStorm,您可以将提交消息与bug跟踪器或问题数据库连接起来,并从VCS日志中的提交导航到与这些提交相关的问题。

  1. Press Ctrl+Alt+S to open IDE settings and select Version Control | Issue Navigation.Ctrl+Alt+S打开IDE设置并选择“版本控制”|“问题导航”
  2. Configure a list of issue navigation patterns by mapping issue patterns in commit messages with URL addresses of the referenced issues.通过将提交消息中的问题模式与引用问题的URL地址映射,配置问题导航模式列表。

    • If you are using JIRA or YouTrack, click Add JIRA pattern   Icons toolbar decorator add jira or Add YouTrack Pattern Icons toolbar decorator add you track on the toolbar, and type the URL to the installation of the bug tracking system. 如果您正在使用JIRAYouTrack,请单击工具栏上的“添加JIRA模式Icons toolbar decorator add jira或“添加YouTrack模式Icons toolbar decorator add you track,然后键入安装错误跟踪系统的URL。
      WebStorm will automatically add a regular expression that defines the navigation pattern.WebStorm将自动添加定义导航模式的正则表达式。

    • For other issue tracking systems, click the Add button Icons general add to create a new entry or select an existing entry and click the Edit button. 对于其他问题跟踪系统,请单击“添加”按钮Icons general add创建新条目,或选择现有条目并单击“编辑”按钮。In the Add Issue Navigation Link dialog that opens, specify the following:在打开的“添加问题导航链接”对话框中,指定以下内容:

Example例子

Issue ID pattern问题ID模式

A regular expression that defines the format in which issues are referenced in commit messages.定义提交消息中引用问题的格式的正则表达式

[A-Z]+\-\d+

This regular expressions matches all character strings that consist of two substrings separated by an n-dash character:此正则表达式匹配由两个子字符串组成的所有字符串,这两个子字符串由一个n-短划线字符分隔:

  1. Substring 1: An unlimited number of upper case alphabetic characters.子字符串1:不限数量的大写字母字符。

  2. Substring 2: An unlimited number of digital characters.子字符串2:无限数量的数字字符。

A combination of the URL address of your issue tracking system and a regular expression that identifies issues in it.问题跟踪系统的URL地址和识别其中问题的正则表达式的组合。

http://<mytracker>/issue/$0

Here $0 indicates a back reference to the entire match. 这里$0表示对整个匹配的反向引用。This means that as soon as WebStorm detects a match in a commit message, it is added to the URL address of the tracker as is.这意味着一旦WebStorm在提交消息中检测到匹配,它就会按原样添加到跟踪器的URL地址。

Matching issue ID匹配问题ID

WebStorm detects the following reference to an issue in the commit message of interest:WebStorm检测到对感兴趣的提交消息中的问题的以下引用:

MYPROJECT-110

Composed issue link

In accordance with the above issue navigation pattern, the detected matching reference is added to the URL of the tracker as is, so the link to the referenced issue is composed as follows:根据上述问题导航模式,检测到的匹配参考按原样添加到跟踪器的URL中,因此指向参考问题的链接组成如下:

http://mytracker/issue/MYPROJECT-110

Last modified: 10 June 2021