Is there any API to retrieve a project ID by passing the project name

Usha Yerreddu June 25, 2018

For our automation testing - Users will pass 'Project Name', 'Version Name' and 'Cycle Name' in the test suit Json, we are trying to create test cycles under the given project and version. Is there any API that can give us the project ID based on the passed project and version name. Or is there any way to identify these IDs from UI

1 answer

1 accepted

2 votes
Answer accepted
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2018
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2018

Or you can find project id by project key. You have to execute GET /rest/api/2/project/{projectIdOrKey}. You can find more info here:

https://developer.atlassian.com/cloud/jira/platform/rest/#api-api-2-project-projectIdOrKey-get

Usha Yerreddu June 25, 2018

Thank you for the quick reply!!

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 25, 2018

If my answer helped you, Kindly accept my answer. In this case other users with a similar question will be able to find this answer.

Usha Yerreddu June 26, 2018

Thank you for the documentation, there is lot of useful information. I am able to get project ID by passing project Key now. However I am still not able to get Version ID by passing Version name. I wish there is a way to get version ID from UI.

Yes, It partially helped me.

Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 26, 2018

You can find version id in ui. Open the version in Jira and look at the url. It will look like this:

http://yourhost/jira/browse/BP/fixforversion/10001

The last part is the version id (10001)

Usha Yerreddu June 27, 2018

Thank you, it worked

akmalick
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 10, 2022

@Alexey Matveev  Thank you so much. That helps but isn't performant. Querying /rest/api/2/project/{projectIdOrKey}  just to get hold of the project id is just so inefficient when the response returned is so bulky. In my case the response size as per postman is 162 KB and it takes about 3 secs.

Shouldn't we have a more specialized endpoint just to return the project Id for a project-key, given the fact that usage of plane project-key is deprecated in few rest apis, like Create Version and yet their usage is so common. Remembering project keys sounds more intuitive than having to remember project Ids or worse yet having to make a heavyweight call to /rest/api/2/project/{projectIdOrKey} and starve our system.

Suggest an answer

Log in or Sign up to answer