You are viewing documentation for the older version of YouTrack!
Skip to end of metadata
Go to start of metadata

Executing Commands from a Comment to a VCS Change Commit

YouTrack allows you to apply commands to issues by specifying them in a comment to a VCS change commit. That is, when commenting your commit specify a command (or several commands) for one or several issues in a specific format, and these commands will be automatically applied to the specified issues in YouTrack. You don't even need to open YouTrack.

Each of command attempts are logged and displayed in an issue's TeamCity Changes and History tabs. If a command provided in a comment can not be executed due to some error, such command will still be shown in the History tab, but as an erroneous command. To see an error reason, hover cursor over the command in the history: the error will be displayed as a tooltip.

General commit comment format for applying commands:

Important notes
  1. YouTrack tries to parse as a command any string after a hash mark (#) with an issueID till the end of the line. If it contains any incorrect commands or attributes, the command will not be applied.
  2. In addition to hash mark, you can also use the circumflex accent mark (^) to denote the issue ID to apply a command to. That is, both '#issueID' and '^issueID' notations are valid.
  3. User accounts taken from TeamCity are compared to user accounts in YouTrack by provided e-mail address.

Batch Issue Operations in Commit Comments

In YouTrack 4.0 we introduce the new feature: applying one command to multiple issues. That is: While committing changes, you can now specify a list of issues that are, for example, fixed by this commit, and provide a command that should be applied to all of them. No more need to specify the same command for each issue individually.

Format of a batch command

For example, the following command should be applied to three issues and should set State to "Fixed", "Reviewed by" field to "john.d", and Revision field to the current revision number:

${revision} placeholder upon processing will automatically be replaced with the current VCS revision number retrieved by TeamCity.

Commenting Issues via Commit Comments

In YouTrack 4.0 we have also added support for commenting issues along with applying commands.

To add a comment to an issue, provide a command to be applied to this issue, and below the command's line provide a comment that should be added along with this change.

For example:

Labels:
execute execute Delete
command command Delete
commit commit Delete
comment comment Delete
vcs vcs Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.