List of (Un)Archived Projects from Database in Jira Datacenter/Server
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
目的
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.
ソリューション
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';
結果の例:
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