how to avoid two time search?


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

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

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!


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 Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Tuesday in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

576 views 1 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