Project Key Underscore

Mitch Wiemans January 25, 2019

Hello,

 

We are currently experimenting with Project Keys and want to add underscores in them. 

We found that this is possible and should be working. However when we add a underscore to a new project, we get the following error:

Project keys must start with an uppercase letter, followed by one or more uppercase alphanumeric characters.

Is there a way to get rid of this and get the underscore to work? 

 

image.png

 

Regards,

Mitch

2 answers

1 accepted

3 votes
Answer accepted
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.
January 25, 2019

The pattern is regulated by a regular expression in Admin -> General -> Advanced.

But don't change it - there are some "interesting" things (i.e. stuff breaks) that happen when a project key is not the standard.  Stick with A-Z as the first character and then A-Z,0-9 for the next 1 to 9.

Mitch Wiemans January 25, 2019

Hi @Nic Brough -Adaptavist-,

thanks for this answer. Currently this is set to: 

 

([A-Z][A-Z0-9]+)


Is is posible to add the underscores which we want as a extra? What i mean is the following: Is everything between the [] and in front of the + default? 

 

So right now we are able to add projects:

ABC123 AND ABCABC

If this is the case, can we change the setting to: 

([A-Z][A-Z0-9]+[A-Z][A-Z0-9-_])

(Added the _)

 

Mitch Wiemans January 25, 2019

Correction: Can I change it to: ([A-Z][A-Z_0-9]+)

 

I found it here: https://confluence.atlassian.com/adminjiraserver/changing-the-project-key-format-938847081.html

 

But i want to know how big the chance is that we break existing things. We currently do not have a lot of issues and will use the new keys in new projects only.

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.
January 25, 2019

I'm not great with regex, but I think it's a bit more simple

[A-Z][A-Z0-9]+  will work fine

[A-Z][A-Z0-9_]+  will allow underscores and break some things (Mostly Apps to be fair - you won't have any problems in Jira)

Mitch Wiemans January 25, 2019

We've just added the _ and it's working!

Thanks :) 

Like Tor Magne Svendsen likes this
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.
January 25, 2019

On the "breaking existing stuff" - you're fine.  The regex is only used to stop you creating projects with dodgy keys, you won't have any problem with existing projects or new ones that still match the old pattern.

Like Mitch Wiemans likes this
0 votes
Christos Moysiadis
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.
January 25, 2019

Hi @Mitch Wiemans

my answer doesnt answer your question but...

Just a question! You have the choice of ~24 letters and 0-9 numbers with max 10char key, plus the combinations!

Why you want to make it this way? Why you just not stick to the pattern of the system? I think it saves a lot of troubles later :D 

Best regards

CM

Mitch Wiemans January 25, 2019

hi @Christos Moysiadis,

 

we will be making a project for each country and each type of system.

For example:

Netherlands system named Test using system Test 2 will be:

NL_TEST_TEST2

For out Service Desk this would make a lot of sence :)

 

Regards,

Mitch

Christos Moysiadis
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.
January 25, 2019

It could be made easier as i see. if you want my advice something like that could be possible

For Netherlands as you said:

Country letters as prefix -> NL or DE for Germany

1) For Software : key = NLSOFT or DESOFT

2) For Service D. : key = NLSD or DESD

3) For Business : key = NLB or DEB

how about this ? just an opinion ;)

Regards,

CM

Mitch Wiemans January 25, 2019

Hi Chris, 

 

I like the way you think :) We had the same exact ideas. However there should be 1 extra tag which is the name. Let's say a car name Volkswagon.

Tag will be: NLVWSOFT (Netherlands, Software, Volkswagon)

We will use this method if the underscore is not posible. But if it is....

NLVWSOFT     = Hard to read quick

NL_VW_SOFT  = Easy to read quick

Louise Simmonds April 28, 2020

How did you get on this this? I have the same issue and have a naming convention but want the issue keys to be easy to read but I also have geographic area, department and project area to add e.g. Australia, Operations, Issue Management:

AU_OPS_IM or

AUOPSIM

I really want to put in the underscores but am nervous!

Thanks!

Mitch Wiemans April 28, 2020

Hi Louise, 

 

I solved this problem as followed. 

 

Right now we have project which we can make as followed:

 

  • AA_BB
  • AA_BBB_CCCC

 

So we can have some text, an underscore, and some text (as much as we want).

 

In order to achieve this you have to be logged in as an administrator. 

Navigate to: Settings -> System and select Advanced Settings.

In the advanced settings menu you have to search for: jira.projectkey.pattern

I have changed the values to: ([A-Z][A-Z_0-9]+) . This allowed us to start a project with 1 or more letters. Then another letter or _ or number

 

Please let me know if this helps!

 

Kind Regards,

Mitch

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.
May 2, 2020

Yes, that's the same as the original answer, but you missed off "it is not recommended to do this as it can break some apps" (plus make it harder to migrate to Cloud, as you'll need to re-key the project before exporting it)

Like Shaun Smith likes this
Bill Bill July 4, 2021

Don't be nervous.  I changed mine on my server years ago to allow underscores and never once had an issue.

However, now that I'm migrating to Cloud I'm fuming that I am losing this flexibility.  YMMV.

Suggest an answer

Log in or Sign up to answer