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
Those are cloud API paths.Try this endpoint -
/rest/api/2/projectvalidate/key
You can see the API's available for your version here.
@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.
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 codedef key = suggestedKeywhile(!isValid(key)){ key = incrementKey(key)}
You have to implement methods
Thank you for your suggestion. @Martin Bayer _MoroSystems_ s_r_o__
It looks like you're new here. Sign in or register to get started.