Issue Key Reset

Shane Poole October 31, 2013

Can I reset the Issue Key for a given project, so that it starts from xxx-1?

8 answers

1 accepted

1 vote
Answer accepted
Abdoulaye Kindy Diallo
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2013
2 votes
Svante Gustafsson Björkegren
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2013

I have used this procedure several times and it does the job!

(https://confluence.atlassian.com/pages/viewpage.action?pageId=211649701)

But I usually discourage my customers to do this because I think that when you have to rely on what number an issue gets your process is wrong. That should be totally irrelevant because you will always end up with special cases to maintain this requirement. Better to take that off the table from start.

I have come across one use-case when I thought it was relevant though. I had a customer with a incident reporting system in Excel (common case ;-) and the existing incidents were already given id's in a sequence. They wanted to migrate this to JIRA without changing the numbering (there were many references to these reports in other systems)

When we had created the JIRA project and tried all the scenarios the pcounter was 134. If we would have imported the spread-sheet at this time the numbering would not have been preserved. So we deleted all test-issues in the project and followed the procedure described in the documentation and when we imported the spread-sheet all existing incidents reports got their correct numbering and all refereces were intact.

In conclusion: If you have built-in values in the numbering in your JIRA project, try to remove that requirement and see the key for what it is, a unique identifier without any value. This is a more maintainable and less complex approach.

If you have specific reasons (e.g. historical) you can move on with the procedure to reset the counter, just make sure you delete all issues in the project before and that you re-start your instance afterwards.

My 2 cents to this topic!

//Svante

2 votes
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 31, 2013

To save you some reading.

No, you can't reset the key. Unless you delete the project completely and re-create it, or start mucking around in the database (delete all issues in the project, stop Jira, backup, change the counter on the project table with a spot of SQL, restart it)

rambabu patina
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2013

We cannot reset the numbering through the user interface.

You can do it directly in the database. This particular SQL is relatively simple and safe compared with other things people make a mess of with SQL - you set the pcounter on each project you need to reset in the "projects" table.

Steps:

Stop the jira --> Take database backup --> run the sql --> Reindex the jira.

1 vote
Jan Szczepanski
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 19, 2021

Hi all,

actually you can reset the project key when using scriptrunner. Here is the snippet, but be careful when using it ;)

https://bitbucket.org/janszczepanski/workspace/snippets/oBkRLy

Eric Sebian March 24, 2021

now you're scaring me. What is there to be careful about? Entering the wrong key?

1 vote
Michael Dennis September 8, 2016

Unfortunately there does NOT seem like a way to do this for JIRA Cloud sad

 

Marlene Vitale March 28, 2018

Really would love to be able to do this. Can Jira from their end reset in cloud?

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 28, 2018

In theory, yes, but I don't think they do it in practice. 

Raise a support request at https://support.atlassian.com/contact and see what the response is.

michal December 11, 2020

If you import single task from e.g. CSV using Settings / System / Import and Export - External System Import and you set your to be starting Key for the task, it will have it and counter will get reset.
Used on cloud Jira - works.

Fernando Pinheiro Felizardo January 18, 2021

Thank you @michal ! This works!

1 vote
Udo Brand
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 31, 2013
0 votes
Daniel Santos
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 13, 2015

Hello,
    This thread is a bit old but this KB is new and may help someone.
    https://confluence.atlassian.com/display/JIRAKB/How+to+reset+the+project+counter+after+moving+issues

0 votes
Shane Poole November 6, 2013

Thanks for all of your answers, much appriciated.

Suggest an answer

Log in or Sign up to answer