how to avoid two time search?

Hi,

I wrote a JQL function (for "issue in myFunction_getIssues()"), inside overriden getValues method

1. wrote sql-jdbc statements to get issueids.(Say I got 50k issue ids). If I return these ids as queryliteral list, I got an error saying, I donot have access to few issue ids. So

2. I tried to filter this id list by passing them to SearchService.search method (Say I got 40K issues/ids)

3. Now I returned this 40k issue ids as queryliteral list from getValues method.

So far it is fine, but please observe that I already performed a search in 2nd step. And the one more search is happend with the returned list in Issue Navigator. Which results in double the time of search.

Could you anybody help me out and suggest me to avoid any one of the searchs to improve the performance?

Thanks a billion in advance!

1 answer

0 votes

You could use hasPermission(browse) for each of the issue IDs. But it's going to be very slow... what's the performance like returning 40k literals? I found it incredibly slow.

You can use a custom field and write your own search, and return Lucene terms which is much faster - that's what I did for the script runner plugin. You might want to try that... https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+JQL+Functions#ScriptedJQLFunctions-Writingyourownfunctions

NB - the point about returning query terms and not literal IDs, is that when the lucene search is done it's combined with a filter that only allows selecting what the current user has visibility of - which is much faster than checking the permissions for each issue individually.

It is taking around 2 minutes to return 40k literals.

Could you please eloberate returning Lucene terms? Can I find these in your groovy source? Any refs please?

Thank you very much in advance!

That bit of the plugin is not open source atm. Try to find a plugin for a custom field that ships with its own searcher...

Thank you very much!

Hi,

I'm trying to create a custom field type using sdk. I have added a custom field module successfully.

but now I don't no which searcher module is suitable to this kind of usage. Here are the types:

1: AbstractInitializationCustomFieldSearcher

2: DateRangeSearcher

3: ExactNumberSearcher

4: ExactTextSearcher

5: NumberRangeSearcher

6: TextSearcher

7: UserPickerSearcher

8: VersionSearcher

9: Custom Searcher Class

Thanks for your help!

You need to write your own... you might want to ask a new question.

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 ...

2,832 views 12 18
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