Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Iterate over JSON and create objects in assets

Dushan Nagahawatta
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
October 15, 2024

I need to create multiple Asset objects using a JSON response. My JSON response is similar to below. This only create the object for first JSON object. What am I doing wrong?

 

"status": "OK",
    "response": [
        {
            "devices": [
                {
                    "deviceudid": "F11243C",
                    "serial_number": "C02GN0K1Q6LW"
                },
                {
                    "deviceudid": "63643363E",
                    "serial_number": "11111"
                },
                {
                    "deviceudid": "F346436436D",
                    "serial_number": "12222"
                },
                {
                    "deviceudid": "F3414364747B88",
                    "serial_number": "333"
                },
                {
                    "deviceudid": "F34644C",
                    "serial_number": "444",
                }

      ]
}]

image.png

 

image.png

1 answer

0 votes
Vijay Dadi
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 3, 2024

Hello @Dushan Nagahawatta ,

I do not see anything wrong in what you are doing, it should create multiple objects. if you don't mind, can you share the full rest response.

Vijay

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events