List of (Un)Archived Projects from Database

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

Purpose

As of Jira 7.10+, Data Center introduced the ability to archive projects.  This article shows how you can identify archived and unarchived projects via a database SQL query.

Solution

SQL Query for getting a list of archived projects:

SELECT pe.property_key,p.* FROM propertyentry pe 
JOIN project p on pe.entity_id=p.id 
WHERE property_key = 'jira.archiving.projects';

Example Results:

jira7135=# select pe.property_key,p.* from propertyentry pe join project p on pe.entity_id=p.id where property_key = 'jira.archiving.projects';
      property_key       |  id   |   pname    | url | lead  | description |   pkey    | pcounter | assigneetype | avatar | originalkey | projecttype
-------------------------+-------+------------+-----+-------+-------------+-----------+----------+--------------+--------+-------------+-------------
 jira.archiving.projects | 10001 | archive me |     | admin |             | ARCHIVEME |        1 |            3 |  10324 | ARCHIVEME   | business
 jira.archiving.projects | 10100 | archiveme  |     | admin |             | ARCME     |        1 |            3 |  10324 | ARCME       | business
(2 rows)


To only get the projects, that are not archived you can use the following SQL query

SELECT * FROM project p 
WHERE
p.id NOT IN (select entity_id from propertyentry where property_key = 'jira.archiving.projects');


SQL Query for getting a timestamp of archived projects:

jira533=# select p.pname,pd.propertyvalue from propertyentry pe, propertydate pd, project p where pe.property_key = 'jira.archiving.projects.date' and pe.entity_id=p.id and pe.id=pd.id;
         pname          |         propertyvalue         
------------------------+-------------------------------
 Validating New project | 2024-01-04 14:53:27.225+05:30
 New Task               | 2024-01-12 20:03:29.869+05:30




Last modified on Jan 30, 2024

Was this helpful?

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