04 Nov 2024 05:40 PM
I am trying to determine a status of a scenario as passed/failed
| fieldsAdd status = event[steps]
Each step record can have a list of element and results:
example:
[ { "result": "passed", "error": "" },{ "name": "I login to profile", "result": "passed", "error": "" }, ]
i need to iterate through it, if any of the result is failed, the scenario will get a failed status
else passed
Thank you
Solved! Go to Solution.
05 Nov 2024 01:57 AM
Hey @olgatimbur
If all you need is whether or not there is a fail could you use the contains function as below?
fetch logs
| fieldsAdd status = if(contains(content, "\"result\": \"failed\""), "failed", else:"passed")