JIRA JQL use the group by function


I had saw the rest api document, and JQL don't support the group by function.

But now I have to use the group by function.

What can I do, could somebody help me?

7 answers

1 accepted

2 votes
Accepted answer

Hi Jiannan,

Apparently JIRA JQL doesn't have the "Group by" syntax at the current moment. I did a quick check on this, and there's an existing feature request which the resolution had been set to Won't Fix:
- https://jira.atlassian.com/browse/JRA-23516

And since you require the Group by syntax to perform searches in JIRA, then perhaps you may try to write a custom JQL function. Reference documentation on this topic can be accessed from the link below:
- https://developer.atlassian.com/display/JIRADEV/Plugin+Tutorial+-+Adding+a+JQL+Function+to+JIRA

I hope that this will help.


And modify code to enable functions to use it.

Thanks, seems I have to extend the JQL.

1 vote

I'm not sure a "group by" is actually useful. Think of it this way - JQL is there to identify issues, not report on them. It therefore drags back a list, which is then pushed through some form of reporting. That reporting could be an issue navigator, a gadget, a chart, a greenhopper board etc etc etc. Some of them might find grouping useful. Most won't. The ones that need grouping (For example, the filter statistics) implement it internally.

There's a bit of a grey area in that JQL does have "order by", but even that is robustly ignored by a lot of reports because it's useless to them.

I think JQL is for finding issues. If you think you need "group by", I suspect you actually need to look at what you really want out of the report and what the users see? How would a group look in the issue navigator? Or a filter statistic or burn-down? (Currently, the closest you can get in the issue navigator is, well, "sort by", as that'll group your issues next to each other)

attaching to Nic Brough's comment:

no plugin, but mostly a report does what you want: https://confluence.atlassian.com/x/EAISCw

If you describe in more detail what you are trying to group by there may be other answers like a plugin might to do it. JQL seems to designed to keep queries looking simple to write. Since you are using a rest-api, you might be able to just access your database directly through a database web service instead.

Since you have not described your use case, the only other 'simple' solution would be to use the rest api to pull over the issues and then load up your local database with the data and apply your query there. The are open source lightweight databases you can use to do the rest of your processing. This approach avoids modifying Jira and keeps your coding local to your environment. You might also be able to use a spreadsheet depending on what you are looking for.

I also agree with Nic at the 90% level about needing group by clauses, but I can see cross project summary reports being available as well.

One of the use case can be where you have to group your issues by milestones and to report on milestone resolution. Since, we cant do group by, I am planning to play in the java.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,143 views 4 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you