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?
King regards,
Tuana
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.