Commit Status Publisher is an open-source plugin that comes bundled with TeamCity (since version 10.0) and allows it to automatically send build statuses of the commits to an external system.
Using it, you can extend the functionality of the integration, so here is a step-by-step guide on how to add it to your build configuration
Adding build features
First, you need to edit your build's configuration settings. Go to the build's page and click Edit Configuration Settings in the top right corner.
There choose the Build Features tab, where you'll be able to add Commit Status Publisher as a new build feature.
Commit Status Publisher set up
By default, VCS Root is set to All attached VCS Roots to publish statuses for commits in all VCS roots, but you can set it to post build statuses for a single repository.
Choose Bitbucket Server (Atlassian Stash) as a publisher, set the Server Base URL, and enter your credentials. Then just test the connection, click on Save, and you are all done!