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

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: Minor
    • Resolution: Done
    • Affects Version/s: 5.4.29
    • Fix Version/s: 5.7.2
    • Labels:
      None
    • Sprint:
      Sprint 44, Sprint 51, DevTools 72, DevTools 73
    • Critical Points:
      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

          Structure

            Activity

              People

              Assignee:
              jmarques Jose Marques
              Reporter:
              jchoules Joanna Choules
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Structure Helper Panel