Mark Robbins
Mark Robbins

Reputation: 2457

Executing Commands from a Comment to a VCS Change Commit in YouTrack/TeamCity Integration

This is not working for me, though I am receiving TeamCity links to YouTrack issues that I put in VCS comments such as ID-nnn, but if I use the form "#ID-nnn fixed" that command is supposed to change the issues status in YouTrack.

As I am trying to get the above to work, I have my YouTrack->TeamCity Integration-> mapping->Actions->Apply Command set to blank, but I have found any command provided there also doing nothing.

My guess is that I am missing some magic dust regarding the state of an Item in YouTrack that would allow it to qualify for the Items VCS command being issued - and that in my testing I am not following a proper workflow. My guess is:

  1. Do a build, release the build in YouTrack (Admin-Project->Fields->Fix Versions, add version number, release it)

  2. Wait for issues to be created and assigned to that build via Item:Affected Versions.

  3. Grab the issue id and use it in VCS comments as a command: #ID-nnn fixed
  4. Commit, triggering build.
  5. Go to YouTrack and see that issues status is now Fixed??

In short, what are the qualifiers for an Item to be affected by VCS commands, what is the proper workflow, and how do I get the integration mapping command (which I left blank above), to work?

Upvotes: 4

Views: 1996

Answers (2)

Niklas Wulff
Niklas Wulff

Reputation: 3524

I also had problem with YouTrack not executing my commands, although they were pulled from SVN correctly.

In my case, YouTrack could find my address in two user profiles, and therefore couldn't decide which user that would execute the command. So the solution was to reassign the "root" account to a colleague and only keep my address in my personal account.

It's a bit strange that the email address is involved at all, it would be better just to match usernames between TeamCity and YouTrack, or have a user mapping setting in YouTrack.

Upvotes: 1

Alex.V
Alex.V

Reputation: 2116

Having an issue set to some specific state when applying a command from commit is not required.

I suggest that you have a look at 'TeamCity Changes' tab of an issue that you expect to be affected by a command. I suspect the most probable reason for this not to work is that YouTrack does not recognize a user the command should run on behalf of. The trick is that YouTrack needs to match VCS commit author to it's user. This implies two steps:

  1. TeamCity matches VCS commit author to it's user. Having correct TeamCity user name on this view guarantees that this step is ok.

  2. YouTrack looks for a matching user by email provided by TeamCity. You can ensure this step completes successfully on the above mentioned 'TeamCity changes' tab. Please also make sure your configuration follows the requirements defined in the doc: http://confluence.jetbrains.net/display/YTD3/Configuring+TeamCity+Integration

Hope this helps.

Best regards,

Alexander Volfman

Upvotes: 2

Related Questions