Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Why Jql parsing not working ?

Hi everyone! Please help .
The code example from the documentation does not produce a specific result for "total issue"

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.web.bean.PagerFilter

def jqlQueryParser = ComponentAccessor.getComponent(JqlQueryParser)
def searchService = ComponentAccessor.getComponent(SearchService)
def issueManager = ComponentAccessor.getIssueManager()
def user = ComponentAccessor.getJiraAuthenticationContext().getUser()

// edit this query to suit

def query = jqlQueryParser.parseQuery("project = JRA AND assignee = currentUser()" )

def search =, query, PagerFilter.getUnlimitedFilter())

log.debug("Total issues: ${}")

search.results.each {documentIssue ->


    // if you need a mutable issue you can do:

    def issue = issueManager.getIssueObject(

    // do something to the issue


1 answer

Hi @Oliver Smith 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 @Oliver Smith I think the problem is in your logging level. Try to change

  • log.debug


  • log.error

Otherwise you need to set logging level on the beginning of the script

  • log.setLevel(Level.DEBUG)

The results will be displayed on Logs tab

Suggest an answer

Log in or Sign up to answer

Atlassian Community Events