Dynamic color changing text box based on Pipeline Build Status

How many results would there be for 10 days for each environment? For example use DEV. How many results would be in the last 10 days that would need to be displayed?

I am thinking just a saved search table but it depends on how many results.

That count will vary.

Can you do it for last 10 builds for each environment.
Last 10 builds for each environment with the cell color to be green and red depending on the status of a build, something like in a heatmap.

I have prepared one scripted field "result_integer" for converting result/status into an integer value depending on which we can change the cell color.
Below is the code for scripted field
if (!doc['result.keyword'].empty) { 
    return doc['result.keyword'].value == "succeeded" ? 1 : 0;    
return null; 

We have changed the approach, now we are fetching last 10 build data and preparing different heatmaps for each environment.
That way, we achieved our usecase in a different manner.