Awesome Graphs shows statistics based on the e-mails contributors used when committing changes to the repository. Sometimes one contributor can use different e-mails which can lead to inconsistent and incomplete data shown by Awesome Graphs.

To address this problem you can:

Awesome Graphs is not case sensitive for user emails.

Use .mailmap in the repository

Starting from Stash 2.5.0 you can use the .mailmap file in your repository to merge several e-mails for one user. However, only it affects only the contributions made after you added or edited the .mailmap file.

Use aliases in the user profile settings

This feature is available only under a commercial or evaluation license.

To join the contributions made by the same person under multiple e-mails before the .mailmap was edited or added, you need to add the missing e-mails in Manage Account - Email addresses for each user.

The easiest way to understand what e-mails should be added is to find identically named users in the Contributors tab, hover over their names and see an e-mail in a pop-up tip.

You can add as many e-mails as you want, unless they are used by other Stash accounts.

The e-mails in the list are marked as follows:

NoteDescriptionCan be deleted
PrimaryThe default user e-mail in Stash.No
Automatically Linked

Counterparts of already existing e-mails differing only in case.

No
UnmarkedE-mails manually added by the user.Yes

Via REST API

The REST API for managing user aliases is located at <bitbucket-host>/rest/awesome-graphs/latest/emails

Via this REST API it is possible to view, add, delete email aliases of Bitbucket Server users. Regular users can perform these operations with their own aliases while Bitbucket system administrators can manage aliases of other users as well.

Viewing aliases

Here is the curl command for viewing your own user aliases:

curl -u username:password http://bitbucket-host/bitbucket/rest/awesome-graphs/latest/emails

For administrators, to view user aliases of others, the curl command needs to include an additional parameter 'user', which value is the username of the user whose alias an administrator wants to view:

curl -u username:password -G -d user=john http://bitbucket-host/bitbucket/rest/awesome-graphs/latest/emails

Below is an example of  the response:

{
  "start": 0,
  "limit": 25,
  "size": 2,
  "isLastPage": true,
  "values": [
    {"email": "john.smith@gmail.com", "automatically": false},  
    {"email": "John.Smith@gmail.com", "automatically": true}
  ]
}

An alias has 2 fields: 

Adding aliases

Here is the curl command for a user to add a new alias for him/herself:

curl -u username:password -X PUT -G -d email=jsmith@example.com http://bitbucket-host/bitbucket/rest/awesome-graphs/latest/emails

For administrators, to add a user alias for another user, the curl command is supposed to include an additional parameter 'user', which value is the username of the user for whom an administrator needs to add an alias:

curl -u username:password -X PUT -G -d user=john -d email=jsmith@example.com http://bitbucket-host/bitbucket/rest/awesome-graphs/latest/emails

When you attempt to add an email address that is already used (by another Bitbucket user or already linked as an alias), you will see the response with display name and the link to the user profile of the current owner of this alias:

{"name": "User", "link": "http://bitbucket-host/bitbucket/users/user"}

Deleting aliases

Here is the curl command for deleting your own alias:

curl -u username:password -X DELETE -G -d email=jsmith@example.com http://bitbucket-host/bitbucket/rest/awesome-graphs/latest/emails

For administrators, to delete an alias of another user, the curl command is supposed to include an additional parameter 'user', which value is the username of the user whose alias an administrator needs to delete:

curl -u username:password -X DELETE -G -d user=john -d email=jsmith@example.com http://bitbucket-host/bitbucket/rest/awesome-graphs/latest/emails

When deleting aliases, it is not possible to delete automatically linked aliases. But when deleting an alias that was added manually or via REST API, a case insensitive search is performed that deletes all found aliases.

In case adding or deleting of aliases is successful, you will get a 200 status code to your HTTP request. When a not existing username is used, you will get a 204 status code.