New auditing features coming to Server/Data Center - What you need to know

I would find that helpful. Raw javadocs are very hard for me to penetrate by themselves. Some sample usage would make my life soo much easier.

Sure, I created a task Log in with Atlassian account to track it.

Just discovering this, and I have a question. My organization has retained every ‘User created’ action since we started using Jira 10 years ago. I would like to find the record for an individual user. I know I can use the following code to get all the records, and filter the resulting stream, as such


        AuditQuery findAll = AuditQuery.builder()
            .from(Instant.ofEpochMilli(0L)).to(Instant.now())
            .actions("User created")
            .categories("user management")
            .build();

        // This consumer was just for learning purposes <g>
        auditSearchService.stream(findAll, 0, 10000, (x) -> System.out.println(x));

But I was kind of hoping one of the query builder options would deal with this.

hey @robertegan305 , I think you can use the resource filter:

AuditQuery query = AuditQuery.builder()
                .resource(com.atlassian.jira.auditing.Type.USER.name(), $userId)
                .build();

If com.atlassian.jira.auditing.Type is not accessible, you can just use “USER”

Just got back to this, and the resource filter did indeed work. But it wants the user key, which threw me for a few minutes.

Generic question, since it is not clear from the documentation. Are you actually consuming events if you inject an EventConsumer? Or are they still passed along to the normal auditing process? I have been tasked with writing a plugin to alert a mailing list when certain audit events occur, and I still want them recorded in the audit database.

Hey Robert, AuditConsumers works independently from each other(each has its own thread), adding a new AuditConsumer has no impact to other AuditConsumers. So the evens will still be stored via normal auditing process (stored to DB and Files, showed in UI).

Is the source code for the atlassian-audit-api package available anywhere? It’s useful to have downloaded so it can be browsed in IDEA while developing.

1 Like

When I download Jira Source from my.atlassian.com, I am able to find these archives within dependencySources/ directory.

  • atlassian-audit-api-1.12.2-sources.jar
  • atlassian-audit-core-1.12.2-sources.jar
  • atlassian-audit-plugin-1.12.2-sources.jar
  • atlassian-audit-spi-1.12.2-sources.jar
2 Likes