Screens cannot be viewed in Jira due to duplicate Operation associations
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Platform Notice: Server, Data Center, and Cloud By Request - This article was written for the Atlassian server and data center platforms but may also be useful for Atlassian Cloud customers. If completing instructions in this article would help you, please contact Atlassian Support and mention it.
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.
*Except Fisheye and Crucible
Problem
When creating issues users get a 500 internal server, and when viewing the Screens admin screen it is blank.
The following appears in the atlassian-jira.log
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Duplicate key com.atlassian.jira.issue.fields.screen.FieldScreenSchemeItemImpl@83d203ad
Diagnosis
Run the following query to find duplicate operation associations:
select fssi.id, fssi.operation, fssi.fieldscreen, fs.name as "Screen Name", fssi.fieldscreenscheme as "Screen Scheme", fss.name from fieldscreenschemeitem fssi
join fieldscreenscheme fss on fssi.fieldscreenscheme = fss.id join fieldscreen fs on fs.id = fssi.fieldscreen
where fssi.fieldscreenscheme in (select fieldscreenscheme from fieldscreenschemeitem group by fieldscreenscheme, operation having count(operation) > 1) and operation in (select operation from fieldscreenschemeitem group by fieldscreenscheme, operation having count(operation) > 1)
Cause
Duplicate operations are associated to the same screen.
Workaround
Remove any duplicate rows. There should only be one operation ID for each screen scheme ID. In this example, there are duplicate operation IDs for the same screen scheme:
id | operation | fieldscreen | Screen Name | Screen Scheme | Name |
---|---|---|---|---|---|
10 | 1 | 100 | PK: Edit/View | 1010 | PK: Screen Scheme |
20 | 1 | 200 | PK: Edit Screen | 1010 | PK: Screen Scheme |
Fix this by deleting the largest ID
delete from fieldscreenschemeitem where ID = 20
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.