How to get the id of a Jira project from a web browser

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Problem

Retrieving the project id from the Jira Database (via the SQL query mentioned below) can be time-consuming, as it requires a Jira user to have access to the Database:

select id from project where pkey = '<PROJECT_KEY>';


The purpose of this article is to describe various ways to get the project ID from the browser (thus avoiding querying the database).

Resolution

There are 2 methods which can be used to view the Project id from the web browser.

  1. From the Project Settings page (requires project administrator or Jira global administrator privileges)
  2. Using the REST API (does not require any administrator privileges)

Resolution #1

  1. Go to Project > View all Projects
  2. Click on the Project Name for the project which you want to view the project id of
  3. Click on Project Settings in the lower left corner.
    • (warning) You must be a project administrator for the project or a Jira administrator in order to view the Project Settings page.
  4. Hover your mouse cursor over the Details button and you can view the project id in the navigation bar at the bottom of browser as shown below:

For the example above, the project id is 10000

Resolution #2

You can obtain the project ID via the REST API by accessing the following URL:

<JIRA_BASE_URL>/rest/api/latest/project/<project_key>

This will provide all of the metadata for the project(s), including the project ID value, as shown in the example of output below (the project id is 10000 in the example below):

{
"expand": "description,lead,url,projectKeys",
"self": "<JIRA_BASE_URL>/rest/api/latest/project/10000",
"id": "10000",
"key": "SCRUM",
"description": "",

...


(info) If you do not provide the project_key then it will return all projects.

(info) It can be helpful to paste the JSON output into a JSON beautifier to improve readability.


Last modified on Aug 13, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.