Can I access the event of a AuditEntity from the Audit API?

Tuana Savrim July 31, 2020

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

1 answer

1 accepted

0 votes
Answer accepted
Chandravadan
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 2, 2020

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events