Reset the project counter and reuse Jira issue keys after moving issues

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

After moving issues from project A (for example, moving A-1 and A-2 issues to a new project) the issue keys A-1 and A-2 can't be reused.

Solution

Environment

Jira Data Center

Jira retains old issue keys to redirect users

Being unable to reuse issue keys after the issues are moved to a new project is expected behavior. When an issue is moved Jira retains the old issue key as a reference.

This allows the old issue links to work by redirecting visitors to the same issue in the new location project. This also allows Confluence links to the old issue, and static links sent via email or similar to continue to work.

Workaround: Manually reset the project counter in the database

If you wish, you can adjust the SQL database manually to prevent this behavior from occurring, which will also allow you to reuse the issue keys that were moved.

Please note that after executing the steps below, old issue links created before moving the issues will stop redirecting to the new issue location. This is a destructive change and could create confusion for users who have pre-existing links to the moved issues.

Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.

Modifying data directly in Jira's database is out of scope for Atlassian Support. These instructions are to help provide guidance if these changes are absolutely needed.

To reset the project count you need to execute the following two steps (please substitute A in the below queries for your project key):

  1. Reset the pcounter field from project table

    1 UPDATE project SET pcounter=0 WHERE pkey='A';
  2. Remove the rows referencing the old issue keys from moved_issue_key

    1 DELETE FROM moved_issue_key WHERE old_issue_key like 'A-%';

After the above steps you should be capable to create issues starting from the number that was set in the pcounter field.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.