Jira Server と Data Center で非アクティブなユーザーのフィルター サブスクリプションと、それに関連するジョブを削除する方法


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

When a user is deactivated, the filter subscriptions and the jobs related to them are still kept in Jira database. In such a scenario, when the Jira admin wants to keep the inactive user's internal reference, but wants to clean up the subscriptions and subscription jobs (hence alleviating the performance when there are several inactive users with subscriptions), a direct action in the database is required.

方法

Please note that all queries below are written for PostgreSQL. If you are using a different DBMS, please adjust accordingly. For any database modification please also record to validate the steps in a lower environment after an environment backup.


Check what inactive users have filter subscriptions with:

SELECT f.id as subscription_id, f.filter_i_d as filter_id, f.username as subscriber_username, appu.lower_user_name as subscriber_lower_user_name, cdu.active as subscriber_user_active 
FROM filtersubscription f 
join app_user appu on f.username = appu.user_key  
join cwd_user cdu on cdu.lower_user_name  = appu.lower_user_name 
where cdu.active = 0;


With the subscriptions listed, we can list the jobs related to them with:

select * from clusteredjob c
where exists (
	select 1 from filtersubscription f 
		join app_user appu on f.username = appu.user_key
		join cwd_user cdu on cdu.lower_user_name  = appu.lower_user_name 
		where cdu.active = 0 and c.job_id like concat('%',f.id) 
)


If the entries are the expected to be removed, you can do it with:

-- Remove the jobs
delete from clusteredjob c
where exists (
	select 1 from filtersubscription f 
		join app_user appu on f.username = appu.user_key
		join cwd_user cdu on cdu.lower_user_name  = appu.lower_user_name 
		where cdu.active = 0 and c.job_id like concat('%',f.id) 
) 

-- Remove the subscriptions
delete from filtersubscription ff where 
ff.id in (
	SELECT f.id 
	FROM filtersubscription f 
	join app_user appu on f.username = appu.user_key  
	join cwd_user cdu on cdu.lower_user_name  = appu.lower_user_name 
	where cdu.active = 0
);

After the deletions, proceed with a rolling restart.


If the subscriptions were removed already and you are facing a "No filter subscription for id xxxxx" in (Admin > System > Scheduler details) you can follow the instructions from this article.




最終更新日 2024 年 7 月 30 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.