scriptrunner-public-2.0.9 /src/main/groovy/com/onresolve/jira/groovy/customfield/CustomFieldBase.groovy

Language Groovy Lines 26
MD5 Hash 045f06c81e2284aca05ef94b3b63490b
Repository https://bitbucket.org/aschuma/scriptrunner-public-2.0.9 View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import com.atlassian.jira.ComponentManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.search.SearchProvider
import com.atlassian.jira.issue.search.SearchRequest
import com.atlassian.jira.issue.search.SearchResults
import com.atlassian.jira.jql.builder.JqlQueryBuilder
import com.atlassian.jira.security.JiraAuthenticationContext
import com.atlassian.jira.web.bean.PagerFilter

Issue issue = issue
ComponentManager componentManager = componentManager

def builder = JqlQueryBuilder.newBuilder()
def query = builder.where().project(issue.projectObject.id).resolution().isEmpty().buildQuery()
SearchRequest sr = new SearchRequest(query)
SearchProvider searchProvider = componentManager.getSearchProvider()
JiraAuthenticationContext authenticationContext = componentManager.getJiraAuthenticationContext()
SearchResults results = searchProvider.search(sr.getQuery(), authenticationContext.getUser(), PagerFilter.getUnlimitedFilter())

log.debug(results.issues.size())

//results.issues.each {
//    issu
//}

1 as Double
Back to Top