Hello,
We have a script that counts the number of issues returned by a JQL:
....
def getSubtaskIssuesFromJQL(String subtaskjql) {
def adminUser = ComponentAccessor.getUserManager().getUserByKey("admin")
def searchService = ComponentAccessor.getComponent(SearchService)
def issueManager = ComponentAccessor.getIssueManager()
SearchService.ParseResult parseResult = searchService.parseQuery(adminUser, subtaskjql)
if (parseResult.isValid()) {
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
String subtaskcomment = ""
def commentManager = ComponentAccessor.getCommentManager()
def searchResult = searchService.search(adminUser, parseResult.getQuery(), PagerFilter.getUnlimitedFilter())
subtaskcomment = "This feature request has " + searchResult.total + " subtasks"
return subtaskcomment
}
}
We would like to extend this by counting how many issue resulted from the query have values in a certain select list field.
Example: SelectList field has values test, test1, test2, test3
The query returns 15 issues. (the select list is mandatory so all of them will have a value)
Output would be: "The feature has 15 issues. 3 test, 3 test1, 5 test2 and 4 test3"
Thank you for any suggestions.