How to get “Project Id” to create a Direct Link?

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}"

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)