I had a custom JQL function using scriptrunner that borrowed a line of code from https://community.atlassian.com/t5/Marketplace-Apps-Integrations/create-jql-function-which-executes-sql-and-puts-results-to-the/qaq-p/305703 suggested by @Jamie Echlin _ScriptRunner - The Adaptavist Group_
new ConstantScoreQuery(new IssueIdFilter(issueIds))
But com.atlassian.jira.issue.search.filters.IssueIdFilter doesn't seem to exist anymore in Jira 8.
Does anyone know what the equivalent should be?
Or is that so old that it wasn't a good approach anyway?
There is no obvious replacement. What we do is, add the following class:
import com.atlassian.jira.issue.index.DocumentConstants
import org.apache.lucene.search.TermInSetQuery
import org.apache.lucene.util.BytesRef
class IssueIdsQuery extends TermInSetQuery {
IssueIdsQuery(Collection<String> ids) {
super(DocumentConstants.ISSUE_ID, ids.collect { new BytesRef(it) })
}
}
then replace:
new ConstantScoreQuery(new IssueIdFilter(issueIds))
with:
new IssueIdsQuery(issueIds)
Thanks, works like a charm.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.