Is an ordering defined for the options of issue fields? Is it possible to change that ordering programmatically for a particular field?
Issue field options are ordered by ID. You can assign your own IDs to options when creating them using PUT (as opposed to POST which assigns an ID automatically for you).
Thanks for your answer, @kkercz. Suppose that my app wants to change the order of the options for a particular issue field at runtime. That would require the app to delete the current options, and re-create them with different IDs. In so doing, any existing values for that issue field for particular issues will be lost, won’t they?
Yes, that sounds right. But you could:
- create a new set of options with the new ordering
- delete old options, replacing them with the new ones
There is an endpoint to delete an option and replace all its usages with a different one: https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-field-fieldKey-option-optionId-issue-delete
I know it’s not ideal, but should work.
Feel free to create an ACJIRA issue for better support for options ordering.