I need to create a gadget (Two Dimensional Filter Statistic) on the dashboard that shows the different components with the corresponding open tickets. In the gadget you cannot limit it to the top 3 components with the most tickets. So how can I create a filter with this requirement? I only want to see the top three components.
Can't be done out of box, JQL does not have any conditions or limits as to what it returns so I truly don't think this can be done with just a single search query.
It could probably be done if there was a custom JQL function which would limit the results returned to the JQL search (using conditional filtering in backend/java before the results are returned for issue search to display), though I'm not aware of any such a thing.
My thinking is it needs to first "pre-fetch" the data so it can filter out what it will return. Something like this: https://docs.adaptavist.com/sr4js/latest/features/jql-functions/custom-jql-functions if you have ScriptRunner. Can't say I ever needed to write it myself but that's the direction I'd be looking.
Alternative approach would be to make the filtering happen inside the gadget, but it's the same idea, a custom gadget vs custom jql function.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.