How to find all the comments related to one user in the database

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

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

Why

It's a common need to visualize the comments a particular user created. Many users have been asking about how to retrieve this data at the database, so here we are presenting the resolution (which was only tested in MySQL databases).

Resolution (JIRA 6.0.8 or previous versions)

Run the query below:

SELECT ji.pkey, ja.actionbody
FROM jiraaction ja, jiraissue ji
WHERE ja.issueid = ji.id
AND ja.actiontype = 'comment'
AND ja.author = 'xxx';

(warning) Please remember to change the value of the ja.author variable from 'xxx' to the actual 'username' from the user.


After JIRA 6.1, some changes where made in the database, in that case you will need to run this query:

Run the query below:

SELECT CONCAT(P.pkey,'-',JI.issuenum) as issuekey, JA.actionbody
FROM jiraaction JA
JOIN jiraissue JI ON JA.issueid = JI.id
JOIN project P ON JI.project = P.id
JOIN app_user U ON U.user_key = JA.author
WHERE JA.actiontype = 'comment'
AND U.lower_user_name = 'xxx';

(warning) Please remember to change the value of the U.lower_user_name variable from 'xxx' to the actual 'username' from the user all in lower case.

The feature request for getting this information through JQL is being tracked here :  JRA-1648 - Getting issue details... STATUS .


最終更新日 2022 年 6 月 23 日

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

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