Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA JQL use the group by function

Hi:

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

2 accepted

5 votes
Answer accepted

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.

Thanks.

And modify code to enable functions to use it.

Like Kara Sanders likes this

Thanks, seems I have to extend the JQL.

Above link doesn't work - can anyone please help? I know its been years...

It's moved to https://developer.atlassian.com/server/jira/platform/adding-a-jql-function-to-jira/

Although I should point out again that it's the wrong place to look.  JQL returns a list of issues, it does not tell whatever is displaying the list how to behave beyond a simple order (and most reports don't care about the order either)

Thanks for the updates.

My question is simple - JQL has a 'order by' feature but not 'group by' feature - Is there any other way or work around to implement 'group by' feature in JQL/JIRA Issues filter / search feature to get the list of issues grouped by 'X'

Thanks 

No, because it's useless. Please have a look at the good questions @Marcelo Lopez is asking, and my more muddled answers to them.  I'm trying to answer it in one thread.

I won't say its useless, found out that Jira doesn't have group by feature.. 

Thx

Actually, it does.  In the reports where it is useful.  Try running a filter through the "filter statistic" gadget - that clearly does "group by".

The point here is not that "group by" is useless, but that it is useless as part of a query, because the query has nothing to say about how the results are portrayed.

1 vote
Answer accepted

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)

Actually, it's very useful....because, and I'll give you an exact use case.

 

Say you want to view progress by "activites completed" in a burn-up while a story is completed, but you can't because there is no "burn-up by 'sub-task'" view. So you switch to using tasks "related to" story so that you can view completed the burn-up "by issue". 

But then, the SwimLane view for the active Sprint defaulted to "by Story", doesn't separate the "Stories" into separate visual swimlanes. 

So you look to create a filter to try to do so, and it turns out you cannot do so. because you cannot group by Story (which one would believe would or should be possible). Practically any query language include a "group by" function, in all this time, why has this never been tackled by Atlassian is beyond acceptable. 

Like # people like this

Have another read of my last paragraph.  It's not that it would not be useful, but that you would have to rewrite EVERYTHING in Jira that works with the results of a search in order to show it to the users.

Welcome to Product Development, @Nic Brough . 

How many users have to tell Atlassian it's not building what they need for that message to get across?

Not trolling you, I'm just being frank with you.

Like # people like this

It doesn't matter.  The problem here is not that you want this function and Atlassian are refusing, but that you're not understanding that it is of no use in the way you've defined for it.

Let's say you create a filter for "colour in (red, green, blue) group by colour".  What does that do when you're using the filter in a filter statistics gadget?  Or for a board?  Or, or, or...

Simply put, you're asking for an ability to do something utterly useless.  The answer to most of the "what would it do in output X" is "absolutely nothing".  So why bother?

Yes, it does matter.

 

It's very simple...incorporate the "Group By" operator in JQL.

 

It doesn't User Story...it says pretty clearly what it desired. Look at other Query Languages perform, and implement that. The fact that this thread has existed for year, people keep asking for, that's a signal. It's a signal that this is useful function.

The fact that others have implemented plugins on top of Jira to perform these sorts of functions is an indicator that this is CORE functionality that should be part of the platform.

Filtering is useful....to a point. To the point where someone feels to need to export to Excel and then create pivot tables to simulate what that operator (Group By) should do in 2020, is ridiculous.

Like # people like this

Ok, so I think I have failed to explain this properly, I'll try another explanation.

I think we all know that a filter returns a pile of issues.

Where I think you're missing the point is that it really is just a pile of issues.  If you want to see this list, in any form, you have to use something that reports on that list.

Let's take just one simple report on that list - the "created vs resolved" report.  How would "group by" be represented in that?  Or a filter statistics set to look at project (and status if you're on the 2d gadget) - how would that show the "group by".

I am not saying "group by" is wrong.  I am trying to point out that it's functionally useless in the filters, because almost all of the places that use filters have zero use for it.

Could you please tell me what a simple "filter statistics" gadget would do with "group by" in its query?  And explain why in that case it should be done in the query rather than the report?

Like Tom Lister likes this

I'm new to Jira, I've often wanted to group my filters.  I'm new to my current role (BA) in a new company.  We have a large backlog I want to work though.
I've been trying to create a dashboard to help me have a nice overview the backlog.  To start with I started looking at the really old stuff (2015 and older)   Easy enough in a query.
But then I decided it would be nice to see how many issues we have per year, I can work my way through it.  
So on my dashboard I have 5 2-dimensial tables, (1 for each year)  would be nice to have this overview in 1 table.  X Axis - Issue Type, Y Axis - year.  

I have wanted to group by other things in the past but can't recall them now.  For me it is would be useful, if I'm trying to use the wrong tool for this and there is a better way it would be good to learn about those. 

It's the same answer as it has been for the last 8 years (or, frankly, the last 19).

If your reporting is not working, fix it.  Jira data reflects what was recorded, not what you'd like to see.

Yes, I know that is grumpy and blunt.  But please do not take that to be an attempt to shut down a conversation or block a question.

You (and I) have a lot of data to try to report on.  If you were to take a step back and look at what you're trying to look at, would "group by irrelevant thing" tell you a lot?

Go back to the report or question - what are you really looking for here?

Thanks for the grumpy and blunt response ;) 
I'm new to Jira, having used DevOps in a previous role, I just want to break the data down into 1 simple table to help me work through it.   It is absolutely not essential and there are other ways to do it.   (but this would have been the simplest view)

Further more, Jira is on our 3rd party developers environment and I don't have access writes to add plug ins or project settings.

So, if it can't be done, fine, that's all I need to know.

Not "can't be done", just "you're looking in the wrong place"

I'm a Jira amateur, where is the right place?  I've tried to explain what my problem is, what I want to see.  how do I do it?  if it's reporting, I can't see any other options in there than I have in the dashboard.  

Have a look at the answer we are commenting on - "group by" done in the JQL is utterly pointless, you need to be looking at what you are reporting on.

Hi @Nic Brough _Adaptavist_ ,

I am new to Jira. I am using Jira Cloud for Scrum boards and Software projects
Here are 2 points


- I am looking for Group By because I wanted originally to group issues in the backlog visually based on certain categorizations such as short-term, mid-term, and long-term. Or maybe other categorization (Feature-request, Tech Debt, Customer-Request, ..etc.). I didn't find a native way in Jira software to do this. I have seen you replied in other threads that I can't add fields (or columns, whatever you name it) based on an attribute attached to an issue. So, I thought to do a JQL filter and group by 'label' as a workaround. Now, you tell us this is not possible as well. If you can help me in this, I would be thankful.

Update - I need to have something like this (but please don't tell me to create fake sprints, because this is short-and-dirty workaround!)

Categorized backlog.png

 

- Please try to understand customers' needs and requests. Honestly, I didn't like your blunt responses and replied in many threads. I mean it. You give customers harsh replies such as 'useless' or 'you don't need it'. Please give some respect to customers' needs. Even if we don't understand the product and you are the expert, you should help us achieve what we need, not educate us how to do work. As a product manager in enterprises for more than 10 years, I think that some responses you give are not the best you can give to customers. Don't' take it personally. I just see myself can't go silent while you jump from one thread to another shutting off customers just because they need a feature to manage their work.

@Nic Brough _Adaptavist_ ,

 

I have posted a comment here 1 hour ago and it was live, but seems it has been deleted, or taken down (or at least I can't see it anymore). 

Would you please clarify?

Please read the answer I gave at the top of this thread again, and don't attribute me for things that I did not say (For example, I never suggested "group by" is useless - you are ignoring the context in which I put it)

Hi @Nic Brough _Adaptavist_

 

- I appreciate your quick responses to customers.
- By any means, there is absolutely nothing here personally targeting you. I just found myself going into rounds while I can't do what I would like to do. No offense. Nothing personal


That said, back to the question

I have read your answer 2 times and still can't find a way to do what I need to do.


Incredibly simple ask, how to categorize the backlog and show these categories visually in groups? Similar to the screenshot I attached in my previous reply.

I think it's a basic requirement, and as a new Jira admin coming from MS World, I wonder why this is not there.

We have periodic BL grooming sessions. Having issues categorized and displayed in groups is exactly what my team needs.

Is there a way to do it? If so, please tell me how

You would need to rewrite the screens and code that renders the backlog, and bear in mind that this would destroy your ability to rank the issues.

Disregarding customer requirements is the first step in a company's downfall. A serious project management tool should offer advanced reporting capabilities.

Like Ashwin Kumar H M likes this

I suggest you re-read the conversation again.  You've missed the parts where the requirement is found to be ill-defined (because it's a guess based on experience of totally different software which is built differently), and, when explored, it's already met, just not the way the guess at a requirement was made.

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
TAGS

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you