We are writing a plugin for Bitbucket using the Java API. Our plugin needs to retrieve audit log entries that resulted from specific events, such as RepositoryAccessedEvent or ProjectCreatedEvent.
Currently I am using the new AuditSearchService (from the Audit API) to get "AuditEntities".
These audit entities have a field auditType which has a field "action".
In some cases the action matches the event but in some cases like RepositoryCreatedEvent the action is just "Repository created".
Why is that? And is there a way I can be sure to always get the event name?
In Bitbucket 7.0, we made significant changes to Auditing and have iteratively made improvements to it since then. With Bitbucket 7.4, we shifted to using human readable summaries for audit events (Repository created) instead of using their actual event names (RepositoryCreatedEvent) which also allows translation of these summaries into different languages.
However, this is done for events raised by core application itself, and may not necessarily be true in the case of events raised by plugins. These are shown as event names to maintain backward compatibility, and our recommendation is to always use human readable sentences, rather than event names for audit entities. Here's the javadoc for the API and the list of audit log events raised by Bitbucket for your reference.
Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your t...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events