Migrating project keys

Hello,

Did anyone find a good solution for changing Jira project keys including all their depended parts?

We are currently trying to migrate to Jira 4.4.4 from Jira 4.4.1. The problem we are facing is the new validator for project keys.

When we started with Jira 3.12 , the project keys had a default scheme which could be changed. There were no restrictions for those keys and we started to use "-" and "[0-9]". In Jira 4.4.1 those characters were discouraged but were still allowed, so we didn't change.

In Jira 4.4.4 however, there is a validator which contains hardcoded "bad characters" which are not allowed. Those include the "-". This leads to a serious problem with our >100 projects.

If we change the pattern on the db level (which is probably discouraged anyway), we can still use our old projects. As soon as the validator gets called, we'll get into a deadlock, though. It will tell us that "-" is not allowed, but we can't change to default pattern, because old projects don't follow it, so there is no valid key pattern we can enter.

We have written some code to replace the project names in the Export/Import XML and for changing the folder structure that Jira has built on the old keys. However there's references to those keys in some Jira issues and especially in our CVS tags, too. We'll probably find even more references in other software like Confluence, too. Those references will all be gone.

Backwards compatibility seemes to have been *slightly* neglected there...

2 answers

1 accepted

0 votes
Accepted answer

Er, it's not "backwards compatibility", it's "not supporting something we told you not to do in the first place". From memory, the documentation has always said "don't use a - because it's already part of the key" since 3.0.3 came out.

I've seen all sorts of problems with allowing an extra "-" in project keys, and I suspect that's exactly why Atlassian have imposed a harder limit on it. I've always fixed it by migrating the broken projects back into A-Z and 0-9 format and then moving issues into projects with safer keys.

I think your fix to replace the export/import and hence move old projects to a safer formatted key is by far the best solution, it's very elegant. Sadly, as you say, there's no easy way to find references in the text fields or CVS tags. For text fields in Jira, you *might* be able to change the renderer that spots them and highlights them so that it knows to be a bit more clever with them, but with external stuff, I'm not sure it's so easy. If you've got urls though, I'd think about a little Apache wizardry, to make it rewrite abc-xyz-123 to abcxyz-123 maybe?

Thank you for the hint with Apache, I'll look into that for the URLs in Jira at least.

As for older versions, I just looked up the old "configuring project keys" page and it didn't say anything about keys that shouldn't be used. But maybe it was written down somewhere else. It's been a while since we started. Here's the link:
http://www.atlassian.com/software/jira/docs/v3.12/project_keys.html

Just to finish this one: we went for the solution I outlined (writing a few scripts to change the filesystem and the export file) and decided against changing the comments. People will have to change their text fields if neccessary. The CVS history will be lost, though.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 16, 2018 in Jira

Looking for anyone who made the switch to Data Center

The Jira Marketing team is putting together an ebook on migrating to Data Center. We're looking for pro tips on how you staffed your project team and organized your Proof of Concept. Share yo...

1,379 views 17 10
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