Hi I am trying to use JQL to sort issues by fields. List of issues can be sorted by a field provided by user.
However, as it turns out, not all fields can be used as parameter to JQL order by clause
e.g.:
/rest/api/2/search?jql=assignee+%3D+currentUser()++ORDER+BY+cf%5B12400%5D+ASC
This will fail e.g. for “Organization” custom field with message:
["Field 'cf[12400]' does not support sorting."]
I am trying to narrow list of fields that can be sorted by. I have looked into /rest/api/2/field, it returns meta for each field, and there is a properties called orderable, e.g:
{ clauseNames: Array(2),
custom :true,
id: "customfield_12400",
key:"customfield_12400",
name:"Organizations",
navigable:true,
orderable:true,
schema: {
custom:"com.atlassian.servicedesk:sd-customer-organizations",
customId:12400,
items:"sd-customerorganization",
type:"array",
}
searchable:true
}
However for “Organization” field, property orderable is set to “true”, so I assume the role of the property is different.
So far i have found 2 fields not supporting sorting: “Organization” and “Approvers”.
For field “Approvers” it gets strange, because its type=array and array items=user, exactly the same as e.g. for “Request participants” field which can be sorted
Is it possible to determine which field can be sorted using JQL using current API?