After upgrading JIRA some specific users don't receive mail notifications
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
症状
JIRA was recently upgraded and some specific users that were included with Single-User notification to the notification scheme don't receive mail notifications. Notification helper shows they will not get notifications, although the user is listed in the notification scheme.
Upon re-add the same user notifications work again, but the user shows up as a duplicate entry as in this screenshot:
診断
Execute the following query and in case it returns any thing, follow the steps of the resolution section:
select * from notification N1, notification N2
where N1.id < N2.id
and N1.scheme = N2.scheme
and (N1.event = N2.event or (N1.event is null and N2.event is null))
and N1.event_type_id = N2.event_type_id
and (N1.template_id = N2.template_id or (N1.template_id is null and N2.template_id is null))
and N1.notif_type = N2.notif_type
and lower(N1.notif_parameter) = lower(N2.notif_parameter);
原因
This issue is caused by database not configured with a supported collation. JIRA needs to use a case-sensitive collation (e.g. for MySQL the database needs to be created using utf8_bin).
ソリューション
Alter your database collation to case-sensitive and execute the following queries against your JIRA database to update the entries to the new casing format:
- Create a database backup before running any query;
Jira をシャットダウンします。
Create a temporary table to store the IDs of the entries that we need to remove from the database:
-- For most databases use this query: CREATE TEMPORARY TABLE notification_fix AS select N1.id from notification N1, notification N2 where N1.id < N2.id and N1.scheme = N2.scheme and (N1.event = N2.event or (N1.event is null and N2.event is null)) and N1.event_type_id = N2.event_type_id and (N1.template_id = N2.template_id or (N1.template_id is null and N2.template_id is null)) and N1.notif_type = N2.notif_type and lower(N1.notif_parameter) = lower(N2.notif_parameter); -- For Oracle use the following query: CREATE GLOBAL TEMPORARY TABLE notification_fix AS select N1.id from notification N1, notification N2 where N1.id > N2.id and N1.scheme = N2.scheme and (N1.event = N2.event or (N1.event is null and N2.event is null)) and N1.event_type_id = N2.event_type_id and (N1.template_id = N2.template_id or (N1.template_id is null and N2.template_id is null)) and N1.notif_type = N2.notif_type and lower(N1.notif_parameter) = lower(N2.notif_parameter);
Remove the duplicated entries:
delete from notification where id in (select id from notification_fix);
Remove the temporary table:
DROP TABLE notification_fix;
Set the entries into the notification table to lower case:
update notification set notif_parameter = lower(notif_parameter) where notif_parameter not in (select lower_user_name from cwd_user) and lower(notif_parameter) in (select lower_user_name from cwd_user);
Jira を再起動します。