how to throw too many results message from JQL function?

Hi,

I have written a JQL function, in that I'm querying jira database, based on the row count I want to throw an error on to Issue Navigator. I want to use the same error that issue navigator by default gives if the resultant issues are more "The 'issue in xxxxx()' clause in your search matches too many results. If a clause returns too many results, the entire search will fail. Please refine or remove the clause and try the search again".

I have tried throwing one exception, it is not displaying error message on top of issue navigator query box, but it is showing a new page with exception stack trace.

Is it possible invoke the existing error message? if so how?, which Exception I need to throw back from JQL function?

Thanks in advance!

2 answers

1 accepted

Yes, it is possible by writing your validation code in your validate() of your JQL class. In that, you can set your Error message in MessageSet which is sent to Issue Navigator.

Note: though you got errors in validation(validate method), it is executing getValues method in JQL. So use one class boolean variable and set it in validate() and check it in getValues().

1 vote

That warning is part of the issue navigator. It's not thrown in a JQL function, it's thrown when the issue navigator is given a search result and it thinks "nope, too big"

If you want to get it in the issue navigator, just give the navigator a search result that's too large.

If you want it in your own code, you'll need to interrogate the search result for the number of issues it's returning and code for putting the warning/error on screen.

Hi Nic,

Thanks! I'm working towards 3rd point in your answer.

It is possible if I can get JiraActionSupport object of parent(issue navigator) in my JQL function.

Is there any way to access it? I have tried looking at ComponentManager, ComponentAccessor, but no use.

Thanks.

I think you're missing the point here - a JQL function returns information for searching on. Informational messages, drawing screens, sending emails, making tea - those are NOT things a JQL function does.

You need to look at where you are going to be displaying the information returned from your search, not the JQL function.

Maybe, if you could explain your end-goal, we can help you a bit more. You seem to be trying to wedge activities into functionality that is simply not designed or intended for those activities. Instead of trying to mangle this, if we had any idea what your end goal was, we may be able to help properly.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,296 views 14 20
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot