How to reset the project counter after moving issues

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Server and Data Center Only - This article only applies to Atlassian products on the server and data center platforms.

Problem

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.

Cause

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).

Workaround

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.

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

    UPDATE project SET pcounter=0 WHERE pkey='A';
  2. 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.


DescriptionAfter 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.
ProductJira
PlatformServer
Last modified on Oct 12, 2018

Was this helpful?

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