Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find the original key for a project?

Rob Horan
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.
September 30, 2021

Assume I'm on either server or datacenter.

There is a project whose key is XYZ.  The key wasn't always XYZ, it was something else in the past.  When?  I don't know.  Sometime.

I want to find the original project key.  How can I do it?

3 answers

2 votes
Mohamed Benziane
Community Champion
September 30, 2021

Hi,

You should be able to retrieve data you want with this api call

rest/api/2/project/<project key>?expand=projectKeys

Take a look at the "Note for developers" section here

https://confluence.atlassian.com/adminjiraserver/editing-a-project-key-938847080.html

1 vote
Kian Stack Mumo Systems
Community Champion
September 30, 2021

I would look in the project_key table. Find the current project key using the select statement

select * from project_key where project_key = '<PROJECT_KEY>';

After you've found the project id, find all the keys associated with that project id by using the query

 

select * from project_key where project_id = '<project_id>'.

 

In theory, the project key with the lowest ID number should be the original project key for your project.

0 votes
VVor January 19, 2022
String proj_key = issue.getProjectObject().getOriginalKey()

I use this piece of code to find original attachments directory

Suggest an answer

Log in or Sign up to answer