Tying git users to teamcity users to youtrack users is not well explained in docs
Mapping git users to Teamcity users was already a little bit confusing, but even once you get that working, its even harder to figure out how to map those uses into youtrack users, for the purpose of executing youtrack commands from git comments.
The biggest problem seems to be this: developer's get to configure their git user.name and user.email properties how ever they want. Many of them screw it up. But Teamcity gives you a fair amount of freedom mapping those user names into Teamcity IDs. So you can work around what the developers did.
When I read the youtrack documentation, it said "User accounts taken from TeamCity are compared to user accounts in YouTrack by provided e-mail address." Great, I thought. I guess it maps the git user to a TeamCity user, then takes the TeamCity user's configured email address and compares it to the YouTrack user's email address.
No luck. The "User (TeamCity User)" column in YouTrack's TeamCity Changes tab is just showing whatever raw VCS user name was extracted from the git commit, which is configurable in TeamCity, and can either be the user.name, the user.email, user.name <user.email>, or finally, the id portion of the user.name (like from bobbarker@priceisright.com, it would extract bobbarker).
Since the extracted user info apparently has to match YouTrack's user id, then I guess I need to reconfigure Teamcity to extract the user.email from git commits, and make sure everyone has configured their user.email property correctly.
Also, when a command fails like this, youtrack sends the admin an email message indicating that a command failed and the reason, which is nice. But in this case, the reason is misleading. It says "A VCS user bbarker had tried to apply command from VCS commit to issue
proj-234 User could not be found in TeamCity ." That makes you think "I guess the git user couldn't be mapped to a TeamCity user", but that's not the case. I can see in TeamCity that it has recognized that commit as mine, which means it did map it to my TeamCity user account. I think the message really means "User could not be found in YouTrack (and btw, it should match the email address)"
It would help to better document the way it currently works, but I think it would work better if it simply mapped the TeamCity user name (not the id information extracted from the git commit) to the youtrack username. Or in youtrack, allow me to configure a VCS or TeamCity user id for each YouTrack id so I can configure that mapping, similar to how TeamCity works.
Please sign in to leave a comment.
Ok, so actually, I can't get this to work no matter what I do. I tried setting everything to my email address (verified git config user.email, set TeamCity to collect emails from commits, set my git id in my TeamCity user account, verified it was the same email on my youtrack account), still doesn't match me up. Maybe this isn't fully implemented yet?
Russell, I'm afraid that there is a problem in our (YouTrack) integration with TeamCity. Message you've got means that TeamCity API doesn't provide us with an info about TeamCity user associated with the VCS user. I've created an issue for this problem: http://youtrack.jetbrains.net/issue/JT-8233
Maxim,
Same problem using Mercurial (or even SVN).
The TC side works well: Using "My Changes" I see both my Mercurial and SubVersion commits/changesets.
Both in TC and YouTrack I have "alias" as username/login and "alias@domain.xyz" for email. SVN commits use "alias" and Mercurial commits use "alias@domain.xyz" -- both are captured well within TC.
But on the YouTrack side everything is fucked up:
There are old YouTrack Issues (SVN times) where in tab "TeamCity Changes" the user is listed as "alias" but is colored red and tooltip is saying "YouTrack user could not be found. Reason: User could not be found in TeamCity".
And today I tried including a YouTrack command inside commit message using Mercurial and the "TeamCity Changes" tab is showing user "alias@domain.xyz" but also saying "YouTrack user could not be found. Reason: User could not be found in TeamCity". And the failed command's tooltip is also saying "Could not resolve Youtrack user".
YouTrack also has sent me an email:
"A VCS user alias@domain.xyz had tried to apply command from VCS commit to issue XY-1234
Error occured while retrieving user information from TeamCity. Contact your system administrator ."
But my system administrator has no idea what to do.
--
/\/\arkus.
Hello Markus,
The most probable reason is that TeamCity user which integration runs on behalf of (configured in YouTrack: Administration->TeamCity Integration->TeamCity Servers->Edit), does not have enough permissions in TeamCity to request user details. Please make sure this user has:
"Modify user profile and roles" global permission
"View project" granted for applicable TeamCity projects
Alexander,
Using TC 6.5.1 there are no such (none at all) user permissions.
Nonetheless I gave the TC user (which youtrack uses) admin privileges (like
the TC integration dialog inside youtrack notes) but now youtrack stopped
picking up "TeamCity Changes" at all (which worked in the past but with the
"user not found" warnings I mentioned.
(The Mercurial commit message got parsed correctly by TC and within TC I
also can navigate to the correspending youtrack issue).
--
/\/\arkus.
To see the permission Alexander is referring to, you have to enable "per-project permissions" in TC 6.5.x Professional editor. It's under Administration->Server Configuration->General. Then go back to the users and groups settings. You'll see new Roles tab, where you can craft the appropriate permissions set.
Not sure yet if that will work though. Haven't been able to test this yet.