Lexorank error when importing Jira project using the Project Configurator for Jira app (PCJ)

Lexorank error when importing Jira project using the Project Configurator for Jira app (PCJ)

While importing a project into the target instance the below error is encountered:

Data import failed with exception: Expected exactly 2 rows; the maximum marker row and the lowest ranked row for rank field[id=13401] com.atlassian.greenhopper.manager.lexorank.LexoRankIntegrityException: Expected exactly 2 rows; the maximum marker row and the lowest ranked row for rank field[id=13401]

 

Follow the below approaches to clear that error:

First Approach

In most of the cases the workaround is to reindex the Jira project after migration. But some users might be reporting missing data. In those cases, check the below scenario:

Appfire’s investigation concluded that the problem occurs from re-indexing after PCJ import. Firstly try the following workarounds that Atlassian suggests in this doc https://confluence.atlassian.com/jirakb/reindexing-fails-with-expected-exactly-2-rows-error-in-jira-server-779158916.html. If that does not work, proceed to the next approach.

Second approach

Check for the value of the custom field which is “Ranking”. If the type of the custom field is numeric and the value is “Ranking” then the above error occurs.

PCJ matches custom fields on value only i.e. com.pyxis.greenhopper.jira:gh-lexo-rank type key is not used when matching custom fields. Hence it is expected that there should be only one field named Ranking and of type com.pyxis.greenhopper.jira:gh-lexo-rank on target. Hence it should be suggested that the numeric custom field Ranking be renamed before import.

For example:

12800,com.pyxis.greenhopper.jira:gh-lexo-rank,com.pyxis.greenhopper.jira:gh-lexo-rank-searcher,Rank,Global rank field for Jira Software use only.,NULL,NULL,NULL,NULL,NULL,NULL,NULL 13401,com.atlassian.jira.plugin.system.customfieldtypes:float,com.atlassian.jira.plugin.system.customfieldtypes:exactnumber,Ranking,Numeric (floating point) input.,NULL,NULL,NULL,NULL,NULL,NULL,NULL 21276,com.pyxis.greenhopper.jira:gh-lexo-rank,com.pyxis.greenhopper.jira:gh-lexo-rank-searcher,Ranking,Global rank field for JIRA Agile use only.,NULL,NULL,NULL,NULL,NULL,NULL,NULL

The above scenario has a custom field 13401 (called ‘Ranking’) which is not a Rank field, it is a number field.

There is another field called ‘Ranking’ that is a Global Rank field, but it has a different ID 21276

Finally, the above case has two fields of the type Global Rank, one called ‘Rank’ with ID 12800 and one called ‘Ranking’ with ID 21276. And one has a number field called ‘Ranking’ with ID 13401.

So as mentioned in the above second approach, PCJ matches custom fields on name only i.e. com.pyxis.greenhopper.jira:gh-lexo-rank type key is not used when matching custom fields. Hence it is expected that there should be only one field named Ranking and of type com.pyxis.greenhopper.jira:gh-lexo-rank on target. So in this case the numeric custom field Ranking i.e. 13401 is renamed before import.