Hi everyone! Please help .The code example from the documentation does not produce a specific result for "total issue" https://scriptrunner.adaptavist.com/5.4.49-jira8/jira/recipes/misc/running-a-jql-query.html
import com.atlassian.jira.component.ComponentAccessorimport com.atlassian.jira.bc.issue.search.SearchServiceimport com.atlassian.jira.jql.parser.JqlQueryParserimport com.atlassian.jira.web.bean.PagerFilterdef jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)def searchService = ComponentAccessor.getComponent(SearchService)def issueManager = ComponentAccessor.getIssueManager()def user = ComponentAccessor.getJiraAuthenticationContext().getUser()// edit this query to suitdef query = jqlQueryParser.parseQuery("project = JRA AND assignee = currentUser()" )def search = searchService.search(user, query, PagerFilter.getUnlimitedFilter())log.debug("Total issues: ${search.total}")search.results.each {documentIssue -> log.debug(documentIssue.key) // if you need a mutable issue you can do: def issue = issueManager.getIssueObject(documentIssue.id) // do something to the issue log.debug(issue.summary)}
Hi @Alex can you share log output, please?
I can see, that JQL query is exactly the same as mentioned in the snippet. Do you really have project with key = JRA created on your Jira instance?
Hi @Martin Bayer _MoroSystems_ s_r_o__ !
the result I expect is "total : 2"
in my console log output :
Hi @Alex I think the problem is in your logging level. Try to change
TO
Otherwise you need to set logging level on the beginning of the script
The results will be displayed on Logs tab
It looks like you're new here. Sign in or register to get started.