After renaming project, old key not available

Esther Lansbergen March 20, 2017

On request of one of our customers, we renamed a project in JIRA from project key HRD to CONFIRM. All issues were renamed from HRD-[#] to CONFIRM-[#]. So far so good.

After this step we would like to create a new empty project with the HRD key in JIRA, but we are getting an error-message that this key is still in use by the other project. We checked the database:

  id   | project_id | project_key

-------+------------+-------------

 14480 |      14111 | CONFIRM

 14111 |      14111 | HRD

 

Is there a way that we can re-use this key again?

Reason for this is that the group is using Bitbucket with the same key and for them it's a big job to change the key for all systems that are using bitbucket.

 

Hope you can help us.

 

Kind regards,

Esther

 

 

 

6 answers

2 votes
Vasiliy Zverev
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.
March 20, 2017

The only option: 

  1. Change issue key back to HDR
  2. Create new project with CONFIRM2 key
  3. Move all issues from HDR to CONFIRM2 
  4. You have HDR key to use.

 

1 vote
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.
April 13, 2018

One extra point that previous answers miss - you also need to think about moved issues.

Imagine you've got project ABC, issues 1 to 60.  If you move ABC-42 to project DEF and it becomes DEF-123, then perform one of the above, you're going to have problems when re-using ABC as a new project code when the new ABC-42 is created.

You'll need to delete DEF-123 to prevent the problems, or choose to destroy the "issue moved" record in the database (there's an issue-moved table that simply lists ABC-42 and 'current issue id', just drop the row and do a full re-index later)

1 vote
Esther Lansbergen March 20, 2017

Thank you all for the quick response smile

We just figured out a solution for our case, which I like to share with you:

  1. Create a new dummy project (name and key is not important)
  2. Make a copy of the permissions of the project HRD
  3. Add your account to the permission roles of the project (otherwise the bulk move is not allowed)
  4. Open the project where the issues are stored now (CONFIRM)  and choose View all issues and filters
  5. Select Tools and all # issues
  6. Move issues
  7. Select the project where you want to move these issues (DUMMY-PROJ)
  8. Change the key of the project CONFIRM back to HRD!
  9. Delete project HRD
  10. Create project HRD
  11. Create project CONFIRM
  12. Move via bulk option the issues from DUMMY-PROJ to CONFIRM
  13. Delete the DUMMY-PROJ

Again: thanks all to share your information with us. I did vote on the JIRA-34945 Thomas.

 

Have a nice day!

1 vote
Tarun Sapra
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 20, 2017

HI Esther,

I was facing an exact same problem which you are facing. Here's how I fixed it (with help from script runner plugin)

I had to free up the older project key "GREP" which was now "DSIT"

1) I copy the project and issues of DSIT to an temporary project with key "DSITEMP"

2)I deleted the DSIT project (only by deleting the project you can free up the older key which was "GREP"

3) Now, recreate the project with key DSIT and move all issues from DSITEMP to DSIT

4) Now since GREP key is free I can create a new project using the key which was earlier unavailable.

To copy the projects with issues I used the "copy project" built-in script from script runner plugin.

1 vote
Thomas Schlegel
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 20, 2017

Hi Esther,

you can't. There is an open issue for that: https://jira.atlassian.com/browse/JRA-34945

Maybe you want to vote for it.

Josh Simnitt August 22, 2018

Thank you, I voted for this also.

0 votes
Konstantin Shtennikov April 12, 2018

Also yet one quickly method (or hack) :)

But you need exec sql query

After (!) rename project in JIRA database:

1. Delete from table project_key record with old key

2. Update table project field ORIGINALKEY to new project key in record with renamed project

After it create and delete empty project every type - JIRA update cache and new key will be free :))))))))))))

Suggest an answer

Log in or Sign up to answer