Sort jira report configuration options

Hi,
i’d like to sort the values of the report plugin configuration by name. I have a select over the issuetypes, which are provided by a values generator:

public class IssueTypeValuesGenerator implements ValuesGenerator {
    public Map<Long, String> getValues(Map params) {  
        Map<Long, String> allValues = new LinkedHashMap<Long, String>();
        List<IssueType> allIssueTypes = new LinkedList<IssueType>(ComponentAccessor.getConstantsManager().getAllIssueTypeObjects());
        Collections.sort(allIssueTypes, new Comparator<IssueType>(){
            @Override
            public int compare(IssueType arg0, IssueType arg1) {
                return arg0.getName().compareTo(arg1.getName());
            }            
        });
        for(IssueType issueType : allIssueTypes){
            allValues.put(Long.parseLong(issueType.getId()), issueType.getName());
        }
        return allValues;
    }
}

However the options are not sorted in the report configuration. Any advice?
Thanks in advance.

Some of JIRA’s internal ValuesGenerators use org.apache.commons.collections.map.ListOrderedMap instead of LinkedHashMap. You could try that.

1 Like

Thanks a lot, that ListOrderedMap does work.