Start by identifying the object within the array using its key. Let's say your array is stored in a variable named mylist
var issue = mylist.find(function(item){ return item.key === 'Failed'; });
Now, if you have a new array:
var failedList = []; // your new array
failedList.push({
key: issue.key,
values: issue.values[0] // assuming you only need the first value
});
There might be a more efficient way to accomplish this. It would be helpful if you can provide additional details on your desired outcome.
UPDATE:
If your intention is to extract all failed results from the array and organize them into a subgroup, you can utilize the reduce method as shown below.
var failedList = mylist.reduce(function(accumulator, item) {
if(item.key === 'Failed'){
var data = {
key: issue.key,
values: issue.values[0]
};
accumulator.push(data)
}
return accumulator;
}, []);