Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ScriptRunner code error

Liugc August 8, 2023

微信图片_20230808174910.png

what shoud i do?

Can anyone post the correct code for me,thanks very much

1 answer

0 votes
Radek Dostál
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.
August 8, 2023

I'm not so sure about SearchProvider, that sounds.. like not the right kind of manager to use.

Usually you would use SearchService, like so, pretty similar syntax and this should fit to your code:

import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.issue.search.SearchResults

SearchService searchService = ComponentAccessor.getComponent(SearchService)
SearchResults<Issue> results = searchService.search(user, query, PagerFilter.getUnlimitedFilter())

results.getResults().each {result ->
// do stuff
}

 

You can of course replace those with "def", but including the actual classes so you know what to look for in javadocs.

Note: do use just the "query" you got from JqlQueryParser

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events