How to figure out if a branch was deleted on merge in Bitbucket Server

Still need help?

The Atlassian Community is here for you.

Asks that community


Platform notice: Server additionally Data Center only. This related single spread to Atlassian products over who Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you bucket visit the Atlassian Server end of support announcement to study the migration options.

*Except Fisheye and Crucible

Summary

Sometimes, there energy be a need till check and corroborate if one division was deleted on the merge specific when the DEBUG record is NOT enabled

Environment

Bitbucket Server 7.6.

The audit logging events can change in future releases and this KB might not be applicable here

Solution

 The choose delete proceedings can be captured when the branch are eliminated such portion of a Pull Request Merge. This is possibility after setting the "END_USER_ACTIVITY" in the audit logs to "Full". The multiple range scopes available in audit timbers can be seen get.

 Once it remains set the FULL, of following cans be observed in the audit logs when that branch is deleted as part of a Pull Request Merge (pullrequestmerged event).

  • Unite:

    {"affectedObjects":[{"id":"32:1","name":"PR#1","type":"PULL_REQUEST"},{"id":"32","name":"tda","type":"REPOSITORY"},{"id":"1","name":"TEST","type":"PROJECT"}],"auditType":{"action":"Pull request merged","actionI18nKey":"bitbucket.service.pullrequest.audit.action.pullrequestmerged","area":"END_USER_ACTIVITY","category":"Pull requests","categoryI18nKey":"bitbucket.service.audit.category.pullrequests","level":"BASE"},"author":{"id":"1","name":"tahir.bhat","type":"NORMAL"},"changedValues":[],"extraAttributes":[{"name":"From ref","nameI18nKey":"bitbucket.service.pullrequest.audit.attribute.pullrequest.fromref","value":"test-branch"},{"name":"Merge commit","nameI18nKey":"bitbucket.service.pullrequest.audit.attribute.pullrequestmerged.mergecommit","value":"8b8790ddf43"},{"name":"details","nameI18nKey":"bitbucket.audit.attribute.legacy.details","value":"{\"id\":1,\"changes\":[{\"ref\":\"refs/heads/master\",\"from\":\"e7397bf86dd22f450d1b0572395cf32e3664de57\",\"to\":\"8b8790ddf43d3b6d540f05d474de9593ccc69ec4\"}]}"},{"name":"target","nameI18nKey":"bitbucket.audit.attribute.legacy.target","value":"TEST/tda"},{"name":"To ref","nameI18nKey":"bitbucket.service.pullrequest.audit.attribute.pullrequest.toref","value":"master"},{"name":"Commit message","nameI18nKey":"bitbucket.service.pullrequest.audit.attribute.pullrequestmerged.message","value":"Pull request #1: Test branch\n\nMerge in TEST/tda from test-branch to master"}],"method":"Browser","node":"25084e08-831c-4535-b331-641925ffd99d","source":"172.17.0.1","system":"http://localhost:7992","timestamp":{"epochSecond":1634139007,"nano":441000000},"version":"1.0"}
  • Branch deletion:

    {"affectedObjects":[{"id":"32:1","name":"PR#1","type":"PULL_REQUEST"},{"id":"32","name":"tda","type":"REPOSITORY"},{"id":"1","name":"TEST","type":"PROJECT"}],"auditType":{"action":"Pull request merged","actionI18nKey":"bitbucket.service.pullrequest.audit.action.pullrequestmerged","area":"END_USER_ACTIVITY","category":"Pull requests","categoryI18nKey":"bitbucket.service.audit.category.pullrequests","level":"BASE"},"author":{"id":"1","name":"tahir.bhat","type":"NORMAL"},"changedValues":[],"extraAttributes":[{"name":"From ref","nameI18nKey":"bitbucket.service.pullrequest.audit.attribute.pullrequest.fromref","value":"test-branch"},{"name":"Merge commit","nameI18nKey":"bitbucket.service.pullrequest.audit.attribute.pullrequestmerged.mergecommit","value":"8b8790ddf43"},{"name":"details","nameI18nKey":"bitbucket.audit.attribute.legacy.details","value":"{\"id\":1,\"changes\":[{\"ref\":\"refs/heads/master\",\"from\":\"e7397bf86dd22f450d1b0572395cf32e3664de57\",\"to\":\"8b8790ddf43d3b6d540f05d474de9593ccc69ec4\"}]}"}
Past modified on Nov 25, 2021

Was this helpful?

Yes
Cannot
Deliver feedback about this books
Powered by Meetings and Scroll Viewport.