The rest api returns the following json for a field.
{
"id": "customfield_10101",
"key": "customfield_10101",
"name": "New custom field",
"untranslatedName": "New custom field",
"custom": true,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"cf[10101]",
"New custom field"
],
"schema": {
"type": "project",
"custom": "com.atlassian.jira.plugin.system.customfieldtypes:project",
"customId": 10101
}
}
I am trying to generate a list of fields which a user can order their JQL by. Naturally you’d think that this would be simple using the “orderable” value but no.
For example the field id “updated” has this orderable value set to false. However… in Jira itself you are able to do an advanced search and select updated as the order by field.
Next comes field id “customfield_10026” (Approvals). This has orderable set to true but if you try to use it Jira returns the following… Not able to sort using field ‘customfield_10026’.
This is not the case for every field returned from the api. But based on this how is it possible to determine and generate a definitive list of fields which a user can order by? This is evidently possible in Jira’s advanced search as it allows you to pick from a list or search for the field.
Any help would be greatly appreciated.