Issues that are found in the Jira database are not accessible through Jira UI

お困りですか?

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

コミュニティに質問

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

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Fisheye および Crucible は除く

要約

In this scenario, the UI shows the following message while trying to view an issue. This happens despite being able to look at a number of other issues in the same project and having admin privileges to view all the issues including archived ones. The issue can be seen to exist in the database while querying the jiraissue table along with the jiraaction and changegroup tables.


環境

All versions of Jira Core 8.x


診断

The following are done to verify if the issue is reachable or can be modified

  • Verify if the issues are archived from the <baseurl>/secure/BrowseArchivedIssues!default.jspa
  • Verify if the issues can be indexed by an admin.
curl -D- -u <user>:<pass> -X POST --data '{"issueId":"<issueid>"}' -H "Content-Type: application/json" <baseurl>/rest/api/2/reindex/issue
  • Verify if the issue can be deleted, if its fine to be deleted after checking there are nothing associated with it from the jiraaction and changegroup tables.
curl -D- -u <user>:<pass> -X DELETE <baseurl>/rest/api/2/issue/<issue id>


原因

It was noticed that, these unreachable issues have been associated for some reason with an issue security scheme that is not associated with the project to which these issues belong. This could have happened from a database corruption or from a database restore or database failure while migrating the issue security levels with a third party plugin. Recently this has been found to happen due to rest api allowing wrong security scheme to be associated with a issue JRASERVER-74605 - Getting issue details... STATUS

For example, JIRA Security Issue Security Scheme is an issue security scheme that is associated with only the project JIRA Application Security and not for any other project. But for some reason, in the database there are some issues from project Bamboo_builds with security level from this issue security scheme. So some of these issues from Bamboo_builds project that are wrongly associated with the issue security levels from the above unrelated issue security scheme fail the permission check. So they throw the error and cannot be viewed. This can be verified by querying the database for these issues for their associated issue security scheme and what the correct security scheme should be, based on the issue security scheme configured for the project.

with cte as (select p.id as projectid, p.pkey || '-' || ji.issuenum as issue,ji.security as security from jiraissue ji join project p on ji.project=p.id and p.pkey || '-' || ji.issuenum in ('<affected issuekey>'))
select T1.issue, T1.IssueSecurityScheme as AssociatedIssueSecurityScheme,T1.issuesecuritylevel as AssociatedIssueSecurityLevel, T2.IssueSecurityScheme as CorrectIssueSecurityScheme from
(select cte.issue as issue,ssl.name as issuesecuritylevel,iss.name as IssueSecurityScheme from cte join schemeissuesecuritylevels ssl on ssl.id = cte.security join issuesecurityscheme iss on ssl.scheme = iss.id) as T1
join
(select cte.issue as issue,iss.name as IssueSecurityScheme from cte join nodeassociation na on na.source_node_id = cte.projectid join issuesecurityscheme iss on na.sink_node_id = iss.id where source_node_entity = 'Project' and sink_node_entity = 'IssueSecurityScheme') as T2
on T1.issue = T2.issue and  T1.IssueSecurityScheme <> T2.IssueSecurityScheme;


ソリューション

After identifying the mismatch in the issue security scheme corresponding to the issue and the project it belongs to, update those issues with an issue security level corresponding to its project.


  1. The available issue security levels for a project can be found as follows.

    select p.pkey as Project,iss.name as IssueSecurityScheme,ssl.name as IssueSecurityLevels,ssl.ID as IssueSecurityLevelID from 
    project p join (select sink_node_id, source_node_id from nodeassociation where source_node_entity = 'Project' and sink_node_entity = 'IssueSecurityScheme')na on na.source_node_id = p.id 
    join issuesecurityscheme iss on na.sink_node_id = iss.id join schemeissuesecuritylevels ssl on iss.id = ssl.scheme;
  2. Update the issues which have wrong issue security level by running an update as follows.

    Please make sure you have a back up of the database before performing any changes to it. Also validate and familiarize yourself with the procedure in a non-production environment first.

    update jiraissue set security = <issuesecuritylevelid from above query> where project = (select id from project where pkey = <project from above query>) and issuenum = <issue number of the issue>




最終更新日 2023 年 5 月 23 日

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

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