jiraquotesatlassian-sourcetreejira-rest-apiscript-console

Quotes in JQL query not working in Jira script console


I am using a JQL query in my code that I am writing in the script console of Jira and I am having some issues with the quotes in the script console as you can see below. enter image description here

Here is the code:

    def query3 = ""
    try{
     query3 = jqlQueryParser.parseQuery("project = \""+myproject.getName()+"\" and created >= -365d and issuetype in (""\"Defect"\"", "Code Roll-in - Maintenance", "Code Roll-in - New Version"))

    }catch(Exception e){
        log.warn("MounaException "+e)
    }

Anyone knows how to fix this problem?


Solution

  • I have found the solution:

    query3 = jqlQueryParser.parseQuery('project = "'+myproject.getName()+ '" and created >= -365d and issuetype in ("Defect","Code Roll-in - Maintenance","Code Roll-in - New Version")')