Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Wrong username in email notification about pull request

Vladimir Pikovski
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 16, 2022

Hi all !

for some reason in our organization , when someone makes commit on open PR it sends the update about the commit with wrong format.

wrong username = other user from our organization

Untitled.png

2 answers

0 votes
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2022

Hi Vladimir and welcome to the community!

 

The part that you marked as 'wrong username' shows the authenticated user that made the push.

 

The part that you marked as 'correct commiter username' is based on the author of the commit, which is configured locally in Git, and has nothing to do with authentication.

 

If the user who pushes these commits is the 'correct user', then based on the email, this user is pushing using the credentials of the 'wrong user'.

The two users may be sharing the same computer that has either the HTTPS credentials or the SSH keys of the wrong user.
If each user uses a different computer, then either the correct user has on their computer HTTPS credentials or SSH keys of the wrong user (which is not advised, credentials and account SSH keys should not be shared with other users), or they are (sometimes?) using the wrong user's computer.

 

I would suggest asking the correct user

  • What type of authentication do they use when they push (HTTPS or SSH)
  • If they use a different computer than the wrong user, check if a Git credential manager has saved the HTTPS credentials of the wrong user or if the SSH keys of the wrong user are present on this computer.
    If that's the case, the correct user will need to remove any HTTPS credentials or SSH keys of the wrong user and use their own instead.

If you have any questions, please feel free to let me know.

Kind regards,
Theodora

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2022

Hello @Vladimir Pikovski ,

Welcome to the Atlassian Community!

The usernames shown in the different sections of the Pull Request e-mail notification come from different sources.

The username from the header (" <username> updated pull request") is based on the bitbucket account used to authenticate the push to bitbucket. This is the user whose credentials were used to authenticate the push.

On the other hand, the Author of the commit is based on the local git configuration of the machine where the commit was created. Once you create a commit in your local repository, git will sign the commit with the username and e-mail address you have in your git-config. To check what is the username current configured you can use the following command : 

git config --get user.email

git config --get user.name

If the user used for pushing and the user configured in your local gitconfig are different, the Pull Request e-mail notification will indeed show different usernames.

In this case, to fix the issue, you would have to either:

  • Configure your Git username/email to use the same username/email used to execute the push to bitbucket.

    or

  • Authenticate the push using the same username currently configured in your git-config.

Hope that helps! Let me know in case you have any questions.

Thank you, @Vladimir Pikovski .

Kind regards,

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events