Identifying the difference between restricted and unrestricted comments in the Jira Database

お困りですか?

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

コミュニティに質問


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

要約

In the Jira Database, restricted comments have the 'rolelevel' set to the ID of the group they are restricted to. 

Below we will demonstrate how to identify these issues. 


診断

We spun up a test instance and created two comments:

  • One Comment that is unrestricted
  • One comment that is restricted to Administrators

Next, we did a simple query to find out the difference between the two comments:

select * from jiraaction;

Results:

IDissueidauthoractiontypeactionlevelrolelevelactionbodycreatedupdateauthorupdatedactionnum
1000010000JIRAUSER10000comment(null)(null)This comment is available to everyone2021-01-08 11:57:06JIRAUSER100002021-01-08 11:57:06(null)
1000110000JIRAUSER10000comment(null)10002This is a restricted comment restricted to administrators2021-01-08 11:57:26JIRAUSER100002021-01-08 11:57:26(null)


 From the results, it appears that:

  • Unrestricted comments have 'rolelevel' set to (null)
  • Restricted comments have the 'role level' set to the ID of the role(In this case Administrators)

Tying this together and modifying the query from How to find all the comments related to one user in the database:

SELECT P.pkey||'-'||JI.issuenum||Ja.rolelevel as issuekey, JA.actionbody, JA.rolelevel
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 rolelevel is null;

Results:

課題キーactionbodyrolelevel
(null)This comment is available to everyone(null)


ソリューション

Restricted comments have the 'role level' set to the ID of the role(In this case Administrators).

Unrestricted comments have the 'rolelevel' as null.


最終更新日: 2021 年 2 月 23 日

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

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