Sorting search results using multi user picker custom field returns error

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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 sorting search results in Issue Navigator using a user picker (multiple users) custom field, the following error appears in the UI.

The following appears in the atlassian-jira.log

2019-09-02 14:07:28,467 http-nio-8810-exec-25 ERROR admin 847x9033x2 4qwqde 10.60.2.3 /rest/issueNav/1/issueTable [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: java.util.ArrayList cannot be cast to java.lang.String
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.String
        at com.atlassian.jira.issue.customfields.impl.MultiUserCFType.compare(MultiUserCFType.java:85)
        at com.atlassian.jira.issue.fields.ImmutableCustomField.compare(ImmutableCustomField.java:1639)
        at com.atlassian.jira.issue.fields.ImmutableCustomField$CustomFieldIssueSortComparator.compare(ImmutableCustomField.java:1729)
        at com.atlassian.jira.issue.fields.ImmutableCustomField$CustomFieldIssueSortComparator.compare(ImmutableCustomField.java:1716)
        at com.atlassian.jira.issue.search.parameters.lucene.sort.DefaultIssueSortComparator.compare(DefaultIssueSortComparator.java:31)
        at com.atlassian.jira.issue.search.parameters.lucene.sort.DocumentSortComparatorSource$InternalFieldComparator.compare(DocumentSortComparatorSource.java:63)
        at org.apache.lucene.search.FieldValueHitQueue$OneComparatorFieldValueHitQueue.lessThan(FieldValueHitQueue.java:81)
        at org.apache.lucene.search.FieldValueHitQueue$OneComparatorFieldValueHitQueue.lessThan(FieldValueHitQueue.java:56)
        at org.apache.lucene.util.PriorityQueue.upHeap(PriorityQueue.java:263)
        at org.apache.lucene.util.PriorityQueue.add(PriorityQueue.java:140)
        at org.apache.lucene.search.TopFieldCollector.add(TopFieldCollector.java:539)
        at org.apache.lucene.search.TopFieldCollector$SimpleFieldCollector$1.collect(TopFieldCollector.java:179)
        at org.apache.lucene.search.Weight$DefaultBulkScorer.scoreAll(Weight.java:233)
        at org.apache.lucene.search.Weight$DefaultBulkScorer.score(Weight.java:184)
        at org.apache.lucene.search.BulkScorer.score(BulkScorer.java:39)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:660)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:462)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:583)
        at org.apache.lucene.search.IndexSearcher.searchAfter(IndexSearcher.java:568)
        at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:493)

Cause

The custom field has no Search Template configured. 

(warning) It only affects User Picker (multiple users)

Resolution

Configure a Search Template for the affected custom field(s).

  1. Navigate to the Custom Fields page (Cog Icon > Issues > Custom Fields)
  2. Locate the affected multi user custom field, click on the cog icon next to it and select "Edit"
  3. In the Search Template dropdown menu, select the only value available and click on "Update"
  4. Verify if the sort works now


(info) Suggestion request to improve the error message - JRASERVER-69922 - Getting issue details... STATUS



DescriptionSorting search results returns error
Product
Jira, Jira Software, Jira Service Management
Last modified on Nov 23, 2020

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.