We have a requirement to sort the displayed issues on a multiple issue picker field.
I've attempted adding the sort the customised JQL but still sorts be created / key with the newest at the top.
We are wanting to sort the displayed selectable issues on a custom field which contains numbers, so that the highest number is as at the top.
we already have the custom fields displayed.
renderOptionHtml = { String displayValue, Issue issue, Closure<String> highlight ->
OutputFormatter.markupBuilder {
i('Service Rank: ' + issue.getCustomFieldValue(OurFields.serviceRankField))
mkp.yield(' - ')
mkp.yieldUnescaped(displayValue)
}
}
I would think you should be able to simply include "order by" in the JQL configuration of your issue picker field.
But I tested it and it doesn't work.
I don't think any of the customization options will let you affect the supplied list other than the JQL.
So you might need to contact adaptavist support to suggest this as a new feature (or perhaps a bug, I don't know why the order by clause in the JQL would be ignored).
Yes that was my first thought, also failed for me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Issue Picker fields can not be sorted unfortunately, there is a good explanation of why this is in our Documentation here, also we have further explanation in this Developer Ticket where the Devs explain why this has been removed: SRJIRA-5280.
You could create your own Issue Picker with the Custom Picker, but as soon as you start typing results to search, the results will also have your own custom sorting order applied which wouldn't be very useful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Olly von Fay-Siebenburgen _ScriptRunner_
Why would having our own sorting order being applied not be very useful? It is our requirement to sort by a nominated field, with the highest value at the top.
i.e. Sorting issues in the order that they need to be worked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Olly von Fay-Siebenburgen _ScriptRunner_
I can only agree with @David Harkins's reasoning. It makes no sense at all to make an Issue Picker field (or any other external field) non-sortable.
If there are technical reasons against sorting, then it is the task of software development to solve them and not to look for excuses why they don't want to do it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apologies if I wasn't clear - if you apply your own sorting, then it will always apply this sorting method.
For example, if you want to sort by a nominated field, and you start searching for a specific issue, i.e. whenever you type anything into the search of the Issue Picker, it will always apply the sort to whatever you type. Essentially, it will render your searched query useless.
If you're not actually typing anything into the search bar of the Issue Picker, and you just want to see Issues with the highest value a custom field at the top (for example), then applying your own sorting method will be sufficient.
This was a deliberate decision to remove the sorting made by our Development team. Please see the comments made on our Issue discussing this by @Jamie Echlin _ScriptRunner - The Adaptavist Group_.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@David Harkins, have you submitted a support request to Adaptavist?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes this has been raised with Adaptavist
SRJSUP-33375
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Could you please specify what version of Jira and ScriptRunner you are currently using?
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Data Centre Installation
Jira Software 9.4.6
Jira Service Management 5.4.6
ScriptRunner: Installed version: 8.4.0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.