Scripted Field broken after update to 8.2.2

Logan Clemons
Contributor
July 3, 2019

So I have this scripted field:

 

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.event.type.EventDispatchOption
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.index.IssueIndexingService
import com.atlassian.jira.util.ImportUtils;

enableCache = {-> false}

def cField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("FT Target Sprint")
def ret = []
def is = issue.getNumber()

def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def sdUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchProvider = ComponentAccessor.getComponent(SearchProvider)
def epicQuery = jqlQueryParser.parseQuery("project = CWOW AND type = Epic AND \"Parent Link\" = CWOW-${is} ")
def epicResults = searchProvider.search(epicQuery, sdUser, PagerFilter.getUnlimitedFilter())

if(epicResults.total >= 1) {
epicResults.getIssues().each() {
documentIssue ->
def issue = issueManager.getIssueObject(documentIssue.id)
if(issue.getCustomFieldValue(cField) != null){ ret.add(issue.getCustomFieldValue(cField)) }
}
} else return null

def set = ret.toSet()
return set.last()

-----------------------------------------------------------------------------------------------------

After the update to 8.2.2 this is no longer working. It's throwing this error:

 

groovy.lang.MissingMethodException: No signature of method: com.atlassian.jira.issue.search.providers.LuceneSearchProvider.search() is applicable for argument types: (com.atlassian.query.QueryImpl, com.atlassian.jira.user.DelegatingApplicationUser, com.atlassian.jira.web.bean.PagerFilter) values: [{project = "CWOW"} AND {type = "Epic"} AND {Parent Link = "CWOW-27963"}, ...] Possible solutions: search(com.atlassian.jira.issue.search.SearchQuery, com.atlassian.jira.web.bean.PagerFilter), search(com.atlassian.jira.issue.search.SearchQuery, com.atlassian.jira.web.bean.PagerFilter, java.util.Set), search(com.atlassian.jira.issue.search.SearchQuery, org.apache.lucene.search.Collector), each(groovy.lang.Closure)

 

-----------------------------------------------------------------------------------------------------

Im not exactly sure what to do with this information. This was written for scriptrunner by the way. Any help would be appreciated. Thanks!

 

1 answer

4 votes
Andrey Gusev
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 23, 2019

I had same issue.

this post saved my day: https://pineoc.github.io/blog/2019/06/24/jira-8-0-scriptRunner/

ctrlc-ctrlvd examples and they work

Logan Clemons
Contributor
August 24, 2019

Thanks!

Logan Clemons
Contributor
August 24, 2019

Also, what an incredible find, haha!

Ludovic Garcia
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 25, 2020

Thanks for sharing that article!

Marcus Wiering May 6, 2021

Thanks!

Tomáš Vrabec
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 25, 2022

Thanks from 2022! :-) 

Suggest an answer

Log in or Sign up to answer