Audit log improvements for developers

On this page

Still need help?

The Atlassian Community is here for you.

Ask the community


As part of the auditing feature, we have added the following endpoints to our REST API. Refer to this document for information on Java API method calls included in the audit log. 

REST API 

GET /rest/auditing/1.0/events

Parameters

Query parameters

Name

Description

from

Date (date-time)
The start timestamp in ISO8601 format

to

Date (date-time)
The end timestamp in ISO8601 format

offset

Integer (int32)
The number of records to skip

pageCursor

StringLocation of last result returned in format of timestamp,ID. For making a request for page X, the value of this field can be obtained from pagingInfo->nextPageCursor in response for page X-1

limit

Integer (int32)

The maximum number of records returned

userIds

StringAudit event author identifiers separated by comma

categories

StringAudit categories separated by comma

actions

StringComma-separated list of actions which triggered the audit record

affectedObject

StringAffected object type and id separated by comma, with objects separated by semicolon

search

StringSearch expression

outputFormat

StringWhat format output should the server create

scanLimit

Integer (int32)

The maximum number of records to be scanned in the inverse insertion order, the default value is Integer.MAX_VALUE which means there is no limit

Responses

  • Status: 200 - Successful operation
Example
{
  "entities": [
    {
      "affectedObjects": [
        {
          "id": "string",
          "name": "string",
          "type": "string",
          "uri": "string"
        }
      ],
      "author": {
        "avatarUri": "string",
        "id": "string",
        "name": "string",
        "type": "string",
        "uri": "string"
      },
      "changedValues": [
        {
          "from": "string",
          "i18nKey": "string",
          "key": "string",
          "to": "string"
        }
      ],
      "extraAttributes": [
        {
          "name": "string",
          "nameI18nKey": "string",
          "value": "string"
        }
      ],
      "method": "string",
      "node": "string",
      "source": "string",
      "system": "string",
      "timestamp": "2020-09-04T04:12:58.618Z",
      "type": {
        "action": "string",
        "actionI18nKey": "string",
        "category": "string",
        "categoryI18nKey": "string"
      }
    }
  ],
  "pagingInfo": {
    "lastPage": true,
    "nextPageCursor": {
      "cursor": "string"
    },
    "nextPageLink": "string",
    "nextPageOffset": 0,
    "size": 0
  }
}


  • Status: 400 - Bad request
Example
[
  {
    "errors": [
      {
        "key": "string",
        "message": "string"
      }
    ],
    "message": "string",
    "status": 0,
    "timestamp": "string"
  }
]


GET /rest/auditing/1.0/configuration/coverage

Responses

  • Status: 200 - Successful operation
Example
{
   "levelByArea":{
      "global-config-and-administration": "string",
      "user-management": "string",
      "permissions": "string",
      "local-config-and-administration": "string",
      "security": "string",
      "end-user-activity": "string",
      "ecosystem": "string"
   }
}


  • Status: 400 - Bad request
Example
[
  {
    "errors": [
      {
        "key": "string",
        "message": "string"
      }
    ],
    "message": "string",
    "status": 0,
    "timestamp": "string"
  }
]


PUT /rest/auditing/1.0/configuration/coverage

Parameters

Body parameters

Name

Description

body *

Example
{
   "levelByArea":{
      "global-config-and-administration":"base",
      "user-management":"advanced",
      "permissions":"base",
      "local-config-and-administration":"full",
      "security":"advanced",
      "end-user-activity":"full",
      "ecosystem":"full"
   }
}
The "advanced" and "full" parameters can only be set for Data Center.

Responses

  • Status: 200 - Successful operation
  • Status: 400 - Bad request
Example
[
  {
    "errors": [
      {
        "key": "string",
        "message": "string"
      }
    ],
    "message": "string",
    "status": 0,
    "timestamp": "string"
  }
]


GET /rest/auditing/1.0/configuration/retention

Responses

  • Status: 200 - Successful operation
Example
{
  "period":{
     "years": 10,
     "months": 0,
     "days": 0
  }
}
  • Status: 400 - Bad request
Example
[
  {
    "errors": [
      {
        "key": "string",
        "message": "string"
      }
    ],
    "message": "string",
    "status": 0,
    "timestamp": "string"
  }
]


PUT /rest/auditing/1.0/configuration/retention

Parameters

Body parameters

Name

Description

body *

Example
{
   "period":{
      "years": 10
   }
}

Responses

  • Status: 200 - Successful operation
  • Status: 400 - Bad request
Example
[
  {
    "errors": [
      {
        "key": "string",
        "message": "string"
      }
    ],
    "message": "string",
    "status": 0,
    "timestamp": "string"
  }
]

GET /rest/auditing/1.0/configuration/retention/file

The audit log file is only supported for Jira Data Center.


Responses

  • Status: 200 - Successful operation
Example
{
  "maxFileCount": 100
}
  • Status: 400 - Bad request
Example
[
  {
    "errors": [
      {
        "key": "string",
        "message": "string"
      }
    ],
    "message": "string",
    "status": 0,
    "timestamp": "string"
  }
]


PUT /rest/auditing/1.0/configuration/retention/file

The audit log file is only supported for Jira Data Center.

Parameters

Body parameters

Name

Description

body *

Example
{
  "maxFileCount": 100
}

Responses

  • Status: 200 - Successful operation
  • Status: 400 - Bad request
Example
[
  {
    "errors": [
      {
        "key": "string",
        "message": "string"
      }
    ],
    "message": "string",
    "status": 0,
    "timestamp": "string"
  }
]



Java API

As part of this feature, we are auditing the following components and including these method calls in the audit log:

Components audited : (AuditService.audit() will be invoked):

  • ProjectManager (com.atlassian.jira.project.ProjectManager)
  • VersionManager (com.atlassian.jira.project.version.VersionManager)
  • ProjectComponentManager (com.atlassian.jira.bc.project.component.ProjectComponentManager)

Components that are NOT audited:

  • OptionsManager (com.atlassian.jira.issue.customfields.manager.OptionsManager)
  • PermissionManager (com.atlassian.jira.security.PermissionManager)
Last modified on Sep 7, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.