Can not create jira project with old edited project key

Hi,

I created a Jira project with a key earlier and later edited the project key. But later when i tries to create a new Jira project with the old project key which was edited and changed I get an error message Project 'ABC' uses this project key.

Is there any solution for this I need to create the new project with the key.

5 answers

If you really want that you need to clear the old key from project_key table.

We intentionally didn't allow that because then you will break any links from within JIRA or from the outside to issues mentioned under the old key.

If you're afraid of messing with the database (or you can't) you can do another trick - create a new, temporary project (name and key doesn't matter), move issues to that project, remove the original project which will remove also all old keys for it. Then create a project with the key it should have and move back all those issues. Delete the temporary project. Now you're able to create a new project with the key you want.

Hi, according to this document: https://confluence.atlassian.com/display/JIRA/Editing+a+Project+Key

"You won't be able to create a new project with the old project key. However, you can change the renamed project back to the old project key. If you delete the project, all associated keys will be freed and you'll be able to re-use them."

So old keys are still "assigned" to project (because of filters etc.). Currently you can't create new project with the key that was already used.

Hello Michal, is it possible to delete old keys complete from the database and replace them with the new key? Or are new keys just "renaming" the old keys and the internal tracking is still based on the old keys? I am asking this regarding a project import where an old key is colliding with an exisiting key in the new jira instance. Are there options to import this project at all? Cheers, Chris

Hi Chris, Please see Pawel's answer in this thread. Cheers, Michal

So once delete the old project, and create the new project with the key and then from the using project import, I can use both the old and new project.

Am I correct?

Yes you will be able to do that, however you will need to create projects manually before importing them. Please make sure you backup your data before changing anything on your instance.

EDITED COMMENT
This only worked, because the Project was renamed soon after its creation, so that no edited fields, links or moved items existed under the old project name.

Use Pawels trick with the temporary project to be on the safe side to avoid meddling with the DB.

Hi there

I had the same need and tested Pawels suggestion, which worked.

Database: Oracle 12.1
JIRA: 7.7.1

Here is a step-by-step description:

1) Log into your database and delete the record from the project_key table

-- sql script to delete old project name, so that it can be reused in a new project:
delete
from project_key pk
where project_key = 'MYOLDKEY' -- replace this with your own project key
and (select count(*) from project where pkey = pk.project_key) = 0; -- security check: you don't want to delete the currently active project name


-- commit, if exactly one record was deleted:
commit;

 -> this should delete one record exactly, or else you have a mistake in your logic.

2) Restart your Server
-> Note: Reindexing your project doesn't work, as the project key index is not updated in that task.

3) Create your new project in JIRA using the previously deleted project key.

ARGH NO!

You forgot that you must have Jira off line when you do this, and you have only doen part of the job - you've missed the other table you need to change.

Thank you! - I gather you are speaking of the table "changeitem"?

Yes, if you had moved or edited certain item content at the time where the old project-key was active, then you would probably need to edit the records to the new key there.
That didn't apply for us however, because we did the project renaming very soon after creating the project.

I guess the affected items would be:

select * from changeitem
where oldstring like 'MYOLDKEY-%'
or newstring like 'MYOLDKEY-%';

And that still leaves possible links in description and comments open.

In the end Pawels trick with the temporary project is the best solution.

I will edit my original comment as not to mislead other people.

Nope, there are other tables involved here.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

819 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you