Uploaded image for project: 'SR for Bitbucket - Development'
  1. SR for Bitbucket - Development
  2. SRBITB-412

Using projectKey in JQL query template produces static type checking error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Minor
    • Resolution: Done
    • 5.4.29
    • 5.7.2
    • None
    • None
    • Sprint 44, Sprint 51, DevTools 72, DevTools 73
    • 0.7

    Description

      When requiring commits to be associated with Jira issues, you can specify a templated Groovy string as the JQL query that filters the issues. This string is evaluated in a context that includes projectKey, the key of the BB project receiving the commits, but this context is provided only to the script engine and not the static type checker. Thus the type checker complains:

      groovy.lang.GroovyRuntimeException: Failed to parse template script (your template may contain an error or be trying to use expressions not currently supported): startup failed:
      GStringTemplateScript101.groovy: 2: [Static type checking] - The variable [projectKey] is undeclared.
       @ line 2, column 66.
         r out -> out << """project = $projectKey
                                       ^
      
      1 error
      
              at com.onresolve.scriptrunner.canned.bitbucket.util.AbstractRequireValidJiraIssue.buildJqlClause(AbstractRequireValidJiraIssue.groovy:263)
              at com.onresolve.scriptrunner.canned.bitbucket.hooks.RequireValidJiraIssue.doScript(RequireValidJiraIssue.groovy:180)
      

      Attachments

        Activity

          People

            jmarques Zeca Marques [X] (Inactive)
            jchoules Joanna Choules
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: