var jsonData = pm.response.json();
const key2 = jsonData.data.find(u => u.key2 === '100')
const key1 = key2 ? key2.metric : 'not found'
pm.test("Verify Analysis shown is correct", function () {
var jsonData = pm.response.json();
pm.expect(key2.metric).to.eql(4);
I tried this and it worked but As I have to assert many keys and many objects β¦is there any better /optimized scripts to reuse it for each objects in array