I have my project name, but not the numeric Project Id. The latter is needed to use HTML Direct Links.I'm using JIRA 5.0.1
How do I get the numeric Project Id for a given project name?
I've searched the Project Administration area, several other places, the documentation, Google, etc but still can't find a way to get that value.
Thanks.
Go to your project page click on project settings and details. Click on the URL and at the end you should see project ID number.
Project ID: A globally unique identifier for your project. A project ID is a unique string used to differentiate your project from all others in Google Cloud. You can use the Google Cloud console to generate a project ID, or you can choose your own.
This solution does not require admin rights:
Navigate to https://jira.YOURDOMAIN.TLD/rest/api/2/project/YOURPROJECTNAME
and read the id
in the JSON response:
{ "self":"https://jira.YOURDOMAIN.TLD/rest/api/2/project/YOURPROJECTNAME", "id":"12345", ☜ Project Id "key":"YOURPROJECTNAME", "description":.. : }
Navigate to https://jira.YOURDOMAIN.TLD/rest/api/2/project
to get a JSON list of projects.
Bonus: here's a one-liner in Groovy to get the ID:
groovy -e "println new groovy.json.JsonSlurper().parseText("https://jira.YOURDOMAIN.TLD/rest/api/2/project/YOURPROJECTNAME".toURL().text)?.id ?: 'not found'"
A java.io.FileNotFoundException probably means that your JIRA server requires authentication.
Here's a one-liner to list all the visible projects and their ID:
groovy -e "new groovy.json.JsonSlurper().parseText('https://jira.YOURDOMAIN.TLD/rest/api/2/project'.toURL().text)?.each{println it.key+' = '+it.id}"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With