How do you get the name of the user who made the Push?

This question is in reference to Atlassian Documentation: POST service webhook for Bitbucket Server

The documentation for POST service webhook for Bitbucket Server, mentions in more than paragraph, that the JSON payload contains "the name of the user that made the push". However in the sample JSON extract, there is no reference to the user who made the push. How do I get that information fro the POST payload?

1 answer

This widget could not be displayed.

Hi Ashley,

On the page you mentioned the user is listed. Have a look at this part:

"toCommit":{
               "id":"f259e9032cdeb1e28d073e8a79a1fd6f9587f233",
               "displayId":"f259e90",
               "author":{
                  "name":"jhocman",
                  "emailAddress":"jhocman@atlassian.com"
               }

The "Author Name" of the commit it is moving to in this sample case is jhocman.

Best regards,
Thiago Bomfim
DevTools

Hi Thiago,

Thanks for your reply, however I believe it doesn't answer my question.

The user `jhocman` in this case is the author of the commit it is moving to, not necessarily the user who made the push to bitbucket. Does that make sense?

For example my friend James could make three commits, then I could push those commits to bitbucket. In the JSON it will show the author of the `toCommit` as 'James' however I need a way to find out that 'Ashley' made the push to bitbucket.

Hi Ashley,

Sorry for the late response. Got it now. Usually what I said will be the case, but you're right in saying that a user could be pushing commits s/he didn't author. If you want more detailed information on the commit ref changes (i.e. push), you can look into the database in the sta_push_ref. 

The complete query with all the tables you need to join is on this KB:

I hope that helps.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 21, 2018 in Bitbucket

Branch Management with Bitbucket

As a project manager, I have discovered that different developers want to bring their previous branching method with them when they join the team. Some developers are used to performing individual wo...

1,261 views 8 11
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you