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?

chintu Parameshwar Feb 24, 2013

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

0 votes
Answer accepted
chintu Parameshwar Feb 25, 2013

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
Nic Brough [Adaptavist] Community Leader Feb 24, 2013

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.

chintu Parameshwar Feb 24, 2013

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.

Nic Brough [Adaptavist] Community Leader Feb 24, 2013

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 in Next-gen

Introducing subtasks for breaking down work in next-gen projects

Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...

9,938 views 42 44
Read article

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