Symptoms

When you connect the Spira data synchronization services to your instance of Atlassian Jira, you get the following error message (or something similar):

General Error: Web Exception Error calling JIRA REST API: 'The remote server returned an error: (500) Internal Server Error.' Details: 500Duplicate key com.
General Error: Web Exception Error calling JIRA REST API: 'The remote server returned an error: (500) Internal Server Error.' Details: 500Duplicate key com.atlassian.jira.rest.v2.issue.FieldMetaBean@6aacccf6java.lang.IllegalStateException: Duplicate key com.atlassian.jira.rest.v2.issue.FieldMetaBean@6aacccf6

This is caused by a misconfiguration inside Jira itself. According to Atlassian:

There is a field that is appearing on a screen more than once. The cause for the duplicate is not yet known.

Resolution

Atlassian recommends running this SQL command  on the Jira database:

Run the following SQL query towards the database to see if there is a duplicate field in a screen:

select f.name, i.fieldidentifier, count(*)
from fieldscreen f, fieldscreenlayoutitem i, fieldscreentab t
where f.id = t.fieldscreen
and i.fieldscreentab = t.id
group by f.name, i.fieldidentifier having count(*) > 1;

If there is a result shown by running the query above, it means that there is a duplicate in a screen. To remove it, follow the steps below:

  1. Navigate to JIRA Administration > Issues > Screens
  2. Look for the Screen mentioned in the SQL query result e.g. "SSD: Scrum Default Issue Screen"
  3. Click Configure and look for the field e.g. "assignee"
  4. Remove one of the fields from the screen.