I see the document: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-key-and-name-validation/#api-rest-api-3-projectvalidate-validprojectkey-get
I want to Get valid project key.
When I call the rest api which uri is /rest/api/latest/projectvalidate/validProjectKey
the response is <?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>404</status-code><message>null for uri: http://mydomain/rest/api/latest/projectvalidate/validProjectKey?key=HSP</message></status>
Hi @Ronaldo Huang I checked the endpoint on CLoud it it is working as documented. I think you have Server/Cloud problem. I guess you are on Server (at least your question is created with "jira-server" attribute, but the documentation is for Cloud version of Jira.
There is similar endpoint for server but it probably only validates project key and do not suggest valid one:
https://docs.atlassian.com/software/jira/docs/api/REST/8.13.1/#api/2/projectvalidate
@Martin Bayer _MoroSystems_ s_r_o__
Hi, how can I get a suggested valid key from my local jira server by rest api which is like GET /rest/api/3/projectvalidate/validProjectKey on cloud?
Only 'GET /rest/api/2/projectvalidate/key' which validates project key is avaiable in the document above.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ronaldo Huang I don't think it is possible. I'm checking it on old Jira (7.6.x) and it looks like when new project is going to be created, the "key" suggestion is done by JavaScript on frontend and it is validate using mentioned endpoint and it does not provide valid KEY in the response.
I think you will have to do it programatically... for example
only schema of the code
def key = suggestedKey
while(!isValid(key)){
key = incrementKey(key)
}
You have to implement methods
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Those are cloud API paths.
Try this endpoint -
/rest/api/2/projectvalidate/key
You can see the API's available for your version here.
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.