Configure database integrity checks

Still need help?

The Atlassian Community is here for you.

Ask the community

Having duplicate or missing information in the database can cause multiple issues in Jira, such as slow performance, unexpected errors, or inaccurate configurations.

Database integrity checks keep your data accurate and consistent by regularly fixing detected inconsistencies in Jira’s database and trying to reset the data to a stable state. This is useful in various situations, for example:

  • before migrating a project to a new workflow

  • when an external program is modifying Jira's database

  • when troubleshooting a server crash

To configure and adjust database integrity checks, you must be logged in as a user with Jira administrator permissionsOverview of global permissions in Jira

Adjust database integrity checks

After you update to the latest version of the Instance optimizer for Jira app, we will automatically enable scheduled database integrity checks for your instance. This means that the app will regularly detect and fix data inconsistencies based on the preconfigured settings. 

By default, the checks run every Sunday at 3 a.m. Jira system time. More on system information in Jira

Only a subset of checks is enabled initially, but you can adjust the schedule and the list of checks or disable the feature altogether in the Instance optimizer settings:

  1. In the upper-right corner of your Jira app, select Jira administration, and then select System.System settings in Jira administration menu

  2. In the sidebar, navigate to Instance optimizer and then select Database integrity checks. This page lists multiple integrity checks that look for and address common inconsistencies in Jira's stored data. Overview of existing checks

  3. In the Schedule section, set the time for running checks automatically. For guidelines on cron syntax, refer to Constructing cron expressions.

  4. Specify an actor that will execute the checks. By default, a valid system administrator is selected as the actor.

  5. Select the checkboxes next to the checks you want to run. To execute all the checks, choose All checks.

  6. Click Save to run the checks regularly according to the specified schedule. You can also run the checks immediately by selecting the Run manually button. 

    If you’re modifying the list of enabled checks, save your changes before proceeding. Otherwise, only previously saved checks will run.

After being started, all enabled checks will be performed in the background, and appropriate fixes will be made automatically. You can check the actions taken in the advanced audit log by clicking the View logs button.

Each selected database integrity check will produce an audit log entry with the details of what was fixed or removed, regardless of whether the check was initiated manually or automatically. Overview of audit log events in Jira

During the execution, you might notice additional downstream Jira audit events. This is the expected behaviour.

Overview of the integrity checks

This section lists all available database integrity checks and provides details about their execution.

Check issue relations

Check nameIs it long-running?What does it check?

How does it fix detected issues?

Check issues with no associated projects

Yes

Checks if the project ID on the issue points to an existing project.

Deletes the issue if it has no corresponding project. Also deletes:

  • Comments (actions)

  • Worklogs

  • Subtasks

  • Issue links

  • Change items

  • Moved issue key history if the issue was moved between the projects

  • Issue properties

  • Node associations

  • User associations

  • Custom field values

  • Workflow entries

  • Associated notifications

This check permanently deletes the issue and all its associated data. The issue is being deindexed, and the delete event is sent.

This action doesn't remove attachments stored on disk or Amazon S3.

Check issues with no workflow steps

Yes

Checks if the workflow ID on the issue points to an existing workflow entry.

  • Gets the workflow for a given issue type and project.

  • Creates a new workflow entry for a given issue and workflow.

  • Sets the step to the initial status, such as "To do."

  • Removes abandoned records from the workflow entry table (the records that have no corresponding issue).

Overview of database tables in the issue workflow

Check broken issue links

No

Checks if the source or destination issue ID in the issue link points to an existing issue.

Deletes the broken issue link from the database.

Check issue links with invalid issue link types

No

Checks if the LINKTYPE field in ISSUELINK table points to not existing issue link type or is set to null.

Deletes the broken issue link from the database.

Check search requests

Check nameIs it long-running?What does it check?

How does it fix detected issues?

Check invalid project references in search requests

Yes

Checks if a search request (search filter) with a non-empty project field points to an existing project.

  • Deletes corresponding filter subscriptions.

  • If the filter has a column layout, restores the default one. More about search filters

  • Deletes permissions for the search request.

  • Deletes the search request.

  • Deindexes the search request.

Check issue permissions

Check nameIs it long-running?What does it check?

How does it fix detected issues?

Check duplicate permission schemes

Yes

Checks if there are records in the SCHEME_PERMISSIONS table that have the same:

  1. Scheme ID

  2. Permission ID

  3. Permission type. Explore permission types

  4. Parameter

  5. Permission key. Explore project permissions

  • Deletes the duplicated record from the SchemePermissions table.

  • Sends the EntityDeletedEvent, so it's visible in the audit log.

Overview of audit log events in Jira

Check workflows

Check nameIs it long-running?What does it check?

How does it fix detected issues?

Check invalid workflow states

No

Checks if there is an issue that has a corresponding workflow entry ID with a status equal to null or 0 (CREATED).

For all detected issues, sets the corresponding workflow entry state to 1 (ACTIVATED).

Check the current workflow step for each issue

No

Checks if the issue’s current status in the workflow is correct.

This check iterates through all the issues on the instance. Depending on the number of issues, it can be a long-running operation.


Depending on the use case, it can or can’t be fixed.

Use case 1. The issue has a null status.

Result: this check can't be fixed. Use “Check issues with a null status” instead.

Use case 2. The issue’s workflow status ID is null.

Result: this check can't be fixed. Use “Check issues with no workflow steps” instead.

Use case 3. The issue has a status set, but there is no linked step descriptor for this status in its workflow.

Result: this check can't be fixed.

Use case 4. We found 0 records in the current step table for the issue with the given workflow entry ID.

Result: This check creates a missing current step for the given Issue ID with a given status and workflow entry ID.

Use case 5. We found 1 record in the current step table for the issue with the given workflow entry ID, but the step ID is null or differs from the one mapped from the issue status.

Result: If the current step record found is invalid, it sets its value in the database. Otherwise, the check skips it.

Use case 6. We found 1+ records in the current step table for the issue with the given workflow entry ID.

Result: Deletes redundant steps and keeps only one.

Check issues with null status

No

If the issue’s status is set to null.

  • Maps the missing issue status using the related current step table and the issue's workflow.

  • Updates the changelog for the issue transition from null to the valid status.

  • Reindexes the issue.

Overview of database tables in the issue workflow

Check field layout schemes

Check nameIs it long-running?What does it check?

How does it fix detected issues?

Check field layouts with no custom fields

No

Checks if all field layout items are pointing to an existing custom field.

A field layout item can specify if a given custom field is required in a given field layout. More about specifying field behavior


Deletes an incorrect record from the field layout item table.

Check filter subscriptions

Check nameIs it long-running?What does it check?

How does it fix detected issues?

Check filter subscriptions with no search filter

No

Checks if a filter subscription is linked to a search filter (search request) that doesn't exist.

  • Unschedules all scheduled jobs for the affected subscription.

  • Deletes the filter subscription from the database.

Check filter subscriptions with a non-existent scheduled job

No

Checks if a filter subscription is linked to a scheduled clustered job that doesn't exist in the clustered job table.

Delete the incorrect record from the filter subscription table.

Property keys for database integrity checks

Database integrity checks use the following application property keys that can be adjusted via the REST API. More about the application-properties module

Property key

Description

Default value

jira.integrity.checker.results.limit

A maximum number of fixes to process if the Check is marked as a long-running one.

1000

jira.integrity.checker.workflow.current.step.batch.size

Batch size for the check: the current workflow step for each issue.

1000

jira.integrity.checker.filter.subscription.batch.size

Batch size for check: filter subscriptions with no search filter.

1000





Last modified on Nov 4, 2025

Was this helpful?

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