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?
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.
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)
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:
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:
I hope that this will help.
attaching to Nic Brough's comment:
no plugin, but mostly a report does what you want: https://confluence.atlassian.com/x/EAISCw
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.
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.