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!
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().
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.
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.
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-...
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