This is for building the structure.
If (MATCH(issuetype, "Epic") ; If (MATCH(resolved,""); If (MATCH(JOIN#children{storystatus},"*NOPLAN*"); "{panel:bgColor=#ff5733}NEED PLAN{panel}"; MATCH(JOIN#children{storystatus},"*RED*"); "{panel:bgColor=#ff5733}LATE{panel}"; MATCH(JOIN#children{storystatus},"*YELLOW*") ; "{panel:bgColor=#ffc300}AT RISK{panel}"; "{panel:bgColor=#0cff00}ON PLAN{panel}"); "{panel:bgColor=#0cff00}COMPLETE{panel}" ) )
this is the Formula for variable story status
IF(issuetype != "Epic"; IF(!DEFINED(resolution); case( sprint; ""; "NOPLAN"; "/(?:,([^,]+)){2}/"; "RED"; "/(?:,([^,]+)){1}/"; "YELLOW"; "GREEN" ) ) )