Problem

You ran a JQL query with the issue in collaborationLinks() filter and got no results.

Finding the cause

First, you’ll need to check that the project scope you’re searching for exists and contains issues with Collaboration links. Remember that Collaboration links should be of the following types:

Jira internal links (duplicates, blocks, relates to, etc.) will not be matched by the in collaborationLinks() JQL filter.

Performance issues of large Jira projects

Filtering issues that have a collaboration link adds complexity to the JQL search being executed. Unfortunately, because of both how Atlassian enables app developers to contribute to the JQL search, and how Atlassian indexes custom links in Jira, there are very strong technical limitations to this feature. Each request requires that we open and check every issue in the selected project. Which, depending on the size of your projects, could greatly increase the execution time of the query.

Jira has a fixed limit of 60 seconds for a query to return the results to the user. If a query has not yet returned results after 60 seconds, the query will silently fail and the page will display the No issues were found to match your search message.

Checking the cause

To quickly verify that this is the issue you’re facing, you can simply refresh the page.

The URL should contain the JQL query that was last executed, for example: https://<FQDN>/issues/?jql=project%20%3D%20%22Jira%20Project%20With%20Lot%20of%20Issues%22%20AND%20issue%20in%20collaborationLinks().

The load time may be very long (a few minutes), but the page should ultimately load. If the page loads, this confirms that you hit a performance threshold.

Checking the logs

To firther confirm this is the cause of your issue, ask a Jira admin to connect to your Jira instance, check the atlassian-jira-slow-queries.log log file and search for “OslcLinksFunction”, you should find log lines looking like this:

LuceneQueryExecutionEvent{query={project = "10900"}, queryTermMetrics={projid:10900=TermMetric{count=1, isCustomField=false}}, numberOfClausesInQuery=1, executionTime=71143, numberOfResults=-1, collectorType='class com.sodius.oslc.app.jira.server.fields.OslcLinksFunction$1'}

In the above example, the query took 71143ms (more than 70 seconds) to complete, which means that it was not sent to the user to be displayed as a search result, which was instead shown as empty.

Advanced check

If you want to get additional information about this issue, we can enable some extra logging in Jira:

  1. Go to Jira system administration, then on to the Logging and profiling page.

  2. Click Configure logging level for another package.

  3. Enter the following package name: com.sodius.oslc.app.jira.server.fields.OslcLinksFunction

  4. Select the Debug logging level.

Now, execute the failing JQL query, wait for the “No issues were found to match your search” message, and open the atlassian-jira.log file. Search for "OslcLinksFunction“ in the file and you’ll find a block of log looking like this:

< No scoped projects to search in, this function requires at least one scoped 
> Searching CollaborationLinks for []
> resolving user determinated projects: [PROJECT_NAME]
< [PROJECT_ID] resolved user determinated projects
Determined projects = [PROJECT_ID]
Retained projects = [PROJECT_ID]
Starting issues search...
CODE

The last line indicates that we started processing the query, for small to medium-sized projects (up to 10000 issues) you would have found the following line in the logs shortly after:

Remote issues search finished with 175 issues found.
CODE

This indicates that the query successfully completed, with the number of results found. Comparing the starting time with the ending time should give you the duration of the request.

If you experienced a timeout, you will not see this last log line right after the query immediately. But you will see it after it has concluded. Please review the log after some additional time if you don’t see it yet.

Solutions

If you’re already using the CLM/ELM tool suite from IBM, we suggest using Report Builder with LQE. Having your Jira environment configured as a data source in LQE will allow Report Builder to build reports faster than Jira is executing the filtered JQL.

Related documentation

Adding Jira as a data source

Another solution would be to use https://marketplace.atlassian.com/apps/6820/scriptrunner-for-jira?tab=overview&hosting=cloud as it is doing some indexing which would improve query performances.

Workarounds

The proposed workarounds below will allow you to use any JQL query, even if they would previously timeout after 60 seconds. Note that these are not considered to be solutions to this problem as they could deteriorate the user experience.

A direct hit to the JQL query

Editing a JQL query and executing it will also update the URL in the browser tab with the JQL query being executed. This allows you to save the URL and share it/bookmark it for future use.
The URL looks like this: https://<FQDN>/issues/?jql=PROJECT%20%3D%20%22Jira%20Project%20With%20Lot%20of%20Issues%22%20and%20issue%20in%20collaborationLinks()

How does this solve the issue? When you directly try to reach this URL, Jira will execute the query with the initial page load, which means we are bypassing the 60 seconds timeout since it only applies to requests executed after the page is first rendered. Such requests are called Ajax requests, or asynchronous requests.