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

how to throw too many results message from JQL function?


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

0 votes
Answer 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.


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 Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published Apr 09, 2019 in Portfolio for Jira

Portfolio for Jira 3.0 is here!

The wait is over... Portfolio for Jira Server and Data Center 3.0 is now officially here! Platform releases offer Atlassian an opportunity to shift our strategy, make bold predictions about t...

1,359 views 14 26
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