Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-4575

The - i.e. dash symbol is not recognised in the JQL query when using issueFunction in dateCompare

    Details

    • Type: Bug
    • Status: Done
    • Priority: Critical
    • Resolution: Done
    • Affects Version/s: 6.3.0-p5, 6.5.0-p5
    • Fix Version/s: 6.18.0
    • Component/s: JQL Functions
    • Labels:
    • Sprint:
      SR4J Sprint 90
    • Critical Points:
      0.8

      Description

      Steps to Reproduce

      1. Add two date fields to a project one for Delivery Date and another for Expected Date
      2. Name either one or both of the date fields with a - i.e. dash symbol. For example Expected-Date
      3. Create a few tickets with sample data and set the date values for these fields
      4. Run a JQL query to filter the issue using the issueFunction in dateCompare filter
        issueFunction in dateCompare("","Expected-Date > Delivery Date")
        

      Current Behaviour

      1. When the JQL Query is executed an error message is returned i.e.,
        Scripted function "dateCompare" compilation failure. Contact administrator and check logs. Message: Field name: Expected not found or not a date or datetime.
        

        as shown in the image below:-

        and an error message is displayed in the log

        2020-08-06 17:49:33,998+0800 http-nio-9091-exec-14 ERROR admin 1069x1060x2 1pa1plw 0:0:0:0:0:0:0:1 /rest/issueNav/1/issueTable [c.o.j.groovy.jql.ScriptedJqlFunction] Script error for function: dateCompare.
        java.lang.Exception: Field name: Expected not found or not a date or datetime.
        	at com.onresolve.jira.groovy.jql.DateCompare.resolveField(DateCompare.groovy:215)
        	at com.onresolve.jira.groovy.jql.DateCompare.dateWindowParser(DateCompare.groovy:167)
        	at com.onresolve.jira.groovy.jql.DateCompare$dateWindowParser$0.callCurrent(Unknown Source)
        	at com.onresolve.jira.groovy.jql.DateCompare.dateCompareParser(DateCompare.groovy:231)
        	at com.onresolve.jira.groovy.jql.DateCompare$dateCompareParser.callCurrent(Unknown Source)
        	at com.onresolve.jira.groovy.jql.DateCompare.extractParameters(DateCompare.groovy:237)
        	at com.onresolve.jira.groovy.jql.DateCompare.validate(DateCompare.groovy:41)
        	at com.onresolve.jira.groovy.jql.JqlFunction$validate$6.call(Unknown Source)
        	at com.onresolve.jira.groovy.jql.ScriptedJqlFunction.validate(ScriptedJqlFunction.groovy:117)
        

      Expected Behaviour

      1. Even though a - i.e. dash character is included in the name of the field, it is expected to execute without any issue.
      2. If the field with a dash is added into a basic JQL, it is able to execute without any problem for example:-

        Attachments

        1. image1.png
          89 kB
          Ram Kumar Aravindakshan
        2. JQL_Query.png
          90 kB
          Ram Kumar Aravindakshan

          Activity

            People

            Assignee:
            wsignoretti Wagner Signoretti
            Reporter:
            rkumar Ram Kumar Aravindakshan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: