I noticed that /rest/api/2/project requires 'key' as in input, is there a way to force 'key' value to be generated by JIRA itself for the sake of uniqueness so that we don't need to pass that value?
The problem is - we are running into errors due to duplicate keys. In order to avoid duplicate 'key' issue we have to make an extra call(s) which to me is inefficient. If there is a 'key', then we should again check for a second 'key' and keep going until we find a unique - which is too much. Is there a way to avoid this situation.
Secondly - how long the key can be?
No, the call really does just do "create with key given". The UI has a bit of code in it that suggests new keys from the description (and it won't suggest duplicates), but that is not something you can use in REST.
A project key has a default maximum length of 10, although that can technically be changed (not recommend though, longer keys get truncated in displays and it may still break some add-ons)
The project key is supposed to be descriptive... by which I mean, it's something specific to the intent of the project to help you identify it. If the project is, say, for documentation, you want the key to be something like "DOC", not something random like "ABC123"; that way, when you get email for issue DOC-764, you know what it's about without having to look up what project "ABC123" represents. What is the system attempting to accomplish? If it's proxying 'create project' requests for users, perhaps you should have them request a key at the same time?
The longest key I've (seen) used is 10 characters; it can probably go longer, but you don't really want them to be too large to fit in the email subject line.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.