Uploaded image for project: 'Jira Service Management Data Center'
  1. Jira Service Management Data Center
  2. JSDSERVER-15963

JSON Import Misinterprets Null Values, Leading to Repeated Errors in Logs

XMLWordPrintable

      Issue Summary

      Steps to Reproduce

      Assets JSON import process improperly handles null values, leading to the logging of repeated errors. It is important to note that null is a special symbol in JSON, and it should not be enclosed in quotes. In the example below, the value for the mobile phone is set as null, which indicates that no values have been assigned to the mobile phone.

      {
       ”name”: “John”,
       ”home phone”: "zbc"
       ”mobile phone”: null
      }

      The challenge we face is that the JSON import process mistakenly interprets null values as strings, leading to incorrect imports based on the object type mapping.

      We have submitted a feature request to address this issue, aiming to enhance the JSON import functionality so that it can accurately recognize null values instead of treating them as strings. In this particular scenario, when an attribute type is set to Default with a Type Value of either Float or Integer, the presence of a null value in the source import file results in the JSON import erroneously attempting to process it as a string. This misinterpretation triggers repeated errors in the Jira logs, specifically with NumberFormatException.

      2024-11-29 10:20:02,111+0100 insight-InsightImportThreadGroup-worker-thread-6 WARN automation     \[c.r.j.p.i.services.model.MutableObjectAttributeValueBean] Could not set object attribute value \(null\) on type ObjectTypeAttributeBean \[id=3673, name=abc, type=DEFAULT, defaultType=DOUBLE]
      java.lang.NumberFormatException: Character n is neither a decimal digit number, decimal point, nor "e" notation exponential mark.
            at java.base/java.math.BigDecimal.<init>\(Unknown Source\)
            at java.base/java.math.BigDecimal.<init>\(Unknown Source\)
            at java.base/java.math.BigDecimal.<init>\(Unknown Source\) 

      The purpose of this bug fix is to enhance the JSON import functionality by correctly identifying null values, thereby preventing the import of these values as strings into attributes of type integer and avoiding the errors.

      Expected Results

      If the value is null for any datalocator, the import should simply ignore it and proceed with importing the other values found in the JSON file.

      Actual Results

      The JSON import process incorrectly interprets null as a value for the data locator, resulting in an error message stating that a null attribute value cannot be imported to the configured attribute type, which is an integer.

      2024-11-29 10:20:02,111+0100 insight-InsightImportThreadGroup-worker-thread-6 WARN automation [c.r.j.p.i.services.model.MutableObjectAttributeValueBean] Could not set object attribute value (null) on type ObjectTypeAttributeBean [id=3673, name=pin, type=DEFAULT, defaultType=DOUBLE]
      java.lang.NumberFormatException: Character n is neither a decimal digit number, decimal point, nor "e" notation exponential mark.
      at java.base/java.math.BigDecimal.<init>(Unknown Source)
      at java.base/java.math.BigDecimal.<init>(Unknown Source)
      at java.base/java.math.BigDecimal.<init>(Unknown Source)
      at com.riadalabs.jira.plugins.insight.services.model.MutableObjectAttributeValueBean.setValue(MutableObjectAttributeValueBean.java:134)
      at com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactoryImpl.createAttributeValues(ObjectAttributeBeanFactoryImpl.java:734)
      at com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactoryImpl.getDefaultTypeValues(ObjectAttributeBeanFactoryImpl.java:680)
      at com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactoryImpl.createObjectAttributeBean(ObjectAttributeBeanFactoryImpl.java:645)
      at com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactoryImpl.createObjectAttributeBean(ObjectAttributeBeanFactoryImpl.java:217)
      at com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactoryImpl.createObjectAttributeBeanForObject(ObjectAttributeBeanFactoryImpl.java:155)
      at com.riadalabs.jira.plugins.insight.services.imports.common.twodimensional.Tw

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

      Versions Tested

      Please confirm all versions that have been tested for this issue, and indicate whether the tested version is affected or not affected, below: 

      Testing Requirements Version Affected Version
      Customers Reported Version Example: 9.14.2 (Yes / No)
      Most Recent Bug-Fix Release    
      Previous Major Release    
      Most Recent LTS 10.3.1 Yes
      Previous Supported LTS    
      Other Versions..    
      (Add rows as needed)    

              bornatowski Bartosz Ornatowski
              90afaff088e0 Navneeth S
              Votes:
              3 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: