JSON_ADD_ITEM: Incorrect results in specific constellations

book

Article ID: 197786

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

The JSON_ADD_ITEM script function works incorrectly when a number ending with 0 is added to a JSON string.

Here is a script to reproduce the error. The attribute "vlan" is added to an empty JSON object.


! Correct result
:SET &I_JSON_OBJECT# = "{}"
:SET &VLANID# = 101
:SET &RET# = JSON_ADD_ITEM(&I_JSON_OBJECT#, "$", &VLANID#, "vlan", number)
:PRINT &I_JSON_OBJECT#

! Wrong result
:SET &I_JSON_OBJECT# = "{}"
:SET &VLANID# = 100
:SET &RET# = JSON_ADD_ITEM(&I_JSON_OBJECT#, "$", &VLANID#, "vlan", number)
:PRINT &I_JSON_OBJECT#



Result:
2020-08-12 10:58:48 - U00020408 {"vlan":101}
2020-08-12 10:58:48 - U00020408 {"vlan":1E+2}

 

Cause

Software Bug

Environment

Release : 12.3

Component : AUTOMATION ENGINE

Resolution

This has been fixed in AE 12.3.5.