How to reset the project counter after moving issues
プラットフォームについて: Server と Data Center のみ - この記事は、サーバーおよびデータセンター プラットフォームのアトラシアン製品にのみ適用されます。
After moving issues from project A to B (e.g. moving A-1 and A-2 issues from A to B) the issue keys moved from project A cannot be used anymore.
This is an expected behavior. When an issue is moved JIRA retains the old issue key as reference. This happens because the old issue links continue to work (confluence links to the old issue, links send to customers and so on will continue to work).
Please note that after executing the steps below the old links (created before moving the issues) will be unavailable or pointing to the new issues with the same moved issue keys. This is very important change, since it can create a lot of confusing to users that already have links to the moved issues.
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):
Reset the pcounter field from project table
UPDATE project SET pcounter=0 WHERE pkey='A';
Remove the rows referencing the old issue keys from moved_issue_key
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.