My question:
I am using the following to help me iterate through some JSON data
let response = pm.response.json();
response.forEach(function(value){
console.info((value.name)+","+(value.id)+","+(value.schema.type))
}
)
The data that I am working with looks this this:
{
"id": "statuscategorychangedate",
"key": "statuscategorychangedate",
"name": "Status Category Changed",
"custom": false,
"orderable": false,
"navigable": true,
"searchable": true,
"clauseNames": [
"statusCategoryChangedDate"
],
"schema": {
"type": "datetime",
"system": "statuscategorychangedate"
}
},
{
"id": "issuetype",
"key": "issuetype",
"name": "Issue Type",
"custom": false,
"orderable": true,
"navigable": true,
"searchable": true,
"clauseNames": [
"issuetype",
"type"
],
"schema": {
"type": "issuetype",
"system": "issuetype"
}
},
{
"id": "parent",
"key": "parent",
"name": "Parent",
"custom": false,
"orderable": false,
"navigable": true,
"searchable": false,
"clauseNames": [
"parent"
]
},
...
The problem is when it iterates through, I get the first 2 values as expected, but the third value throws an error because schema doesn’t exist for that entry.
Details (like screenshots):